New Database Table Pattern

This forum is for programmers who have questions about the source code.
Post Reply
jackcraig66
Posts: 12
Joined: Tue Apr 09, 2013 12:24 pm

New Database Table Pattern

Post by jackcraig66 » Mon Jun 17, 2013 2:38 am

I am currently studying the New Database Table Pattern - is there any general guidance for cases where a table needs a currency-related column? Is it OK to use the decimal type? Looking at various OpenDentBusiness TableTypes it seems double is used where an amount in money is to be stored.

I have only just started looking at this so will reply to my own post if I find anything ...but I'm interested if anyone has suggestions of what to look at or consider...

Thanks!

(see: http://www.opendental.com/manual/patter ... table.html)
Last edited by jackcraig66 on Mon Jun 17, 2013 8:51 am, edited 1 time in total.

jackcraig66
Posts: 12
Joined: Tue Apr 09, 2013 12:24 pm

Re: New Database Table Pattern

Post by jackcraig66 » Mon Jun 17, 2013 8:51 am

...found that the Crud Generator doesn't support the decimal type - see extract from exception below

Code: Select all

System.ApplicationException was unhandled
  ...
  Message=Type not yet supported: Decimal
  ...
       at xCrudGenerator.Form1.WriteAll(StringBuilder strb, String className, Type typeClass, Boolean isMobile) in ...\xCrudGenerator\Form1.cs:line 265
       ...
  InnerException:

User avatar
jsalmon
Posts: 1571
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: New Database Table Pattern

Post by jsalmon » Mon Jun 17, 2013 11:34 am

As you found out, Decimal database types have not been implemented. There hasn't been a need, doubles have been sufficient. Is there are particular reason you are wanting to use decimal instead of double in the database?
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

jackcraig66
Posts: 12
Joined: Tue Apr 09, 2013 12:24 pm

Re: New Database Table Pattern

Post by jackcraig66 » Tue Jun 18, 2013 1:51 am

I think the section towards the end of the Pattern about strings and ints made me think about any issues with other types...

Post Reply