Page 1 of 1

human readable in MySQL

Posted: Mon Feb 11, 2019 2:08 pm
by cmandile
When I run a query within OD, appointment status, and insplan.PlanNum show as words not numbers. Toggling between human readable and raw changes this. I’m building queries in MySQL workbench… is there a way to know where these are coming from and/or display them as words in the MySQL code?

Re: human readable in MySQL

Posted: Tue Feb 12, 2019 7:45 am
by cmcgehee
To show that in MySQL Workbench, you would either need to join onto the table that has the name of item or you would have to hand code a case statement to translate enum values into English names. For example with appointment status, https://www.opendental.com/OpenDentalDo ... ppointment contains a description of AptStatus and what each number corresponds to.

Re: human readable in MySQL

Posted: Tue Feb 12, 2019 9:10 am
by jsalmon
And if you like to peruse source code you could check out FormQuery.MakeReadable() which contains our monster switch statement that takes raw query results and translates them to the Human Readable version that is displayed to the user via C#.

Re: human readable in MySQL

Posted: Tue Feb 12, 2019 2:51 pm
by cmandile
Thanks guys, to clarify for appointment status and insplan.PlanNum there are no tables to join. For appointment status I'd just have to hand code the statuses from the appointment table, and for insplan.planNum I would have to maybe look it up within the software?

Re: human readable in MySQL

Posted: Tue Feb 12, 2019 5:00 pm
by jsalmon
cmandile wrote:Thanks guys, to clarify for appointment status and insplan.PlanNum there are no tables to join.
Status is an enum so no JOIN needed. However, PlanNum is the primary key of a table so odds are you need to JOIN to it from other tables. Basic rule of thumb will be any column that starts with "FK to [table].[Column]" means you have a JOIN in your future in order to get more information about said entity.

Re: human readable in MySQL

Posted: Wed Feb 13, 2019 7:47 am
by cmcgehee
I believe that in the program we display the carrier name in the insplan.PlanNum column. So you would use the insplan.CarrierNum to join to the carrier table to get the CarrierName.