Page 1 of 1

Error generating SQL schema with decimal(38,16)

Posted: Fri 26 Aug 2011 08:29
by vifani
Generating SQL schema from EDMX designer using your devart TT, we get the following error:

The SSDL generated by the activity called ‘CsdlToSsdlAndMslActivity’ is not valid and has the following errors:
Precision ‘38’ is not valid. Precision must be between ‘1’ and ‘29’ for ‘decimal’ type.

I set a decimal field type with 38 precision and 19 scale. I have no errors generating SQL schema for SQL Server.

If I try to manually create a table on Oracle using NUMBER(38,19) as type, I have no errors, so I think there is a problem with your field type validation.

Can you help me?

Posted: Mon 29 Aug 2011 16:57
by Shalex
We have reproduced the error. We will investigate the issue and notify you about the results.

Posted: Wed 31 Aug 2011 12:53
by Shalex
This is a designed behaviour.
We have to take into account only .NET types (not Oracle types) in the Model-first approach. No sense to create column in Oracle if its values do not have the corresponding .NET representation. The maximum precision of .NET type System.Decimal is 28.
It will be incorrect behaviour if precision is lost when reading the value of NUMBER(38,19) from database or if its value is greater than maximum value of the original .NET type property.