oracle double decimal problem
oracle double decimal problem
Hi devart team,
we have a serious problem with numeric columns, returning wrong values from the database!
The column is defined as NUMBER(13,2) the mapping maps this column to double.
The value in the database is 7.39 and after reading via Entity-Framework we get an double value of
7.390000006 !!!!
If we change the ssdl and the csdl to decimal 13,2 we get the correct value
back 7.39 as decimal
(This seems to be a known bug from former database wrappers....)
First Question:
As you anounced precision and scale are now supported,
for database reverse engeneering, but this does not work by default for
all numerics with precision/scale combinations. Only for unspecified columns or colums with specifications that exceeds double precision the decimal is correctly imported as for example decimal 25,20.
(up to now double does not support the usage of precision/scale notation)
What is to be done to get all numeric values mapped with correct precision/scale as double or how can we avoid the wrong conversion of the obove mentioned error.
Is it possible to have a check box to force the reverse engeneering to use decimals instead of doubles???
Tnx for your help
Roman
we have a serious problem with numeric columns, returning wrong values from the database!
The column is defined as NUMBER(13,2) the mapping maps this column to double.
The value in the database is 7.39 and after reading via Entity-Framework we get an double value of
7.390000006 !!!!
If we change the ssdl and the csdl to decimal 13,2 we get the correct value
back 7.39 as decimal
(This seems to be a known bug from former database wrappers....)
First Question:
As you anounced precision and scale are now supported,
for database reverse engeneering, but this does not work by default for
all numerics with precision/scale combinations. Only for unspecified columns or colums with specifications that exceeds double precision the decimal is correctly imported as for example decimal 25,20.
(up to now double does not support the usage of precision/scale notation)
What is to be done to get all numeric values mapped with correct precision/scale as double or how can we avoid the wrong conversion of the obove mentioned error.
Is it possible to have a check box to force the reverse engeneering to use decimals instead of doubles???
Tnx for your help
Roman
double trouble
ok, this should be known before I try to use doubles!!!
Please inform us when the problem is fixed.
It would be nice if you extend the EntityDeveloper to force decimals on demand?
Tnx
Roman
Please inform us when the problem is fixed.
It would be nice if you extend the EntityDeveloper to force decimals on demand?
Tnx
Roman
Re: oracle double decimal problem
I'm seeing this 11 years later, with version 9.13.1098 of dotConnect for Oracle.
On a table defined as NUMBER(12,2), a query in Oracle returns 43518.20 but in C# it is 43518.200000000004
Is there anything I can do?
On a table defined as NUMBER(12,2), a query in Oracle returns 43518.20 but in C# it is 43518.200000000004
Is there anything I can do?
Re: oracle double decimal problem
Your connection mode is OCI (via Oracle Client), isn't it? Direct Mode should work correctly.
The difference in the results between OCI and Direct modes is caused by the data type used for reading data from the server:
* OCI reads double (8 bytes)
* Direct reads number (22 bytes) and converts the number to double at the client side.
As a workaround, either change connection mapping from double to decimal with the "Number Mappings = (Number, 1, 15, System.Decimal);" connection string parameter (for the OCI mode) or switch to the Direct mode.