Decimal scale change between Oracle.ManagedDataAccess v19.6 and 19.7
See original GitHub issueThere seems to be an change between versions 19.6 and 19.7 of Oracle.ManagedDataAccess relating to the default decimal scale when zeros are involved. The new behaviour is also in Oracle.ManagedDataAccess.Core. I can’t find any documentation on this change to know whether it’s an intended change, or a bug?
e.g.
v19.6: select 1.1 as aaa from dual returns 1.10 select 1.10 as aaa from dual returns 1.10 select 1.100 as aaa from dual returns 1.10
v19.7 select 1.1 as aaa from dual returns 1.1 select 1.10 as aaa from dual returns 1.1 select 1.100 as aaa from dual returns 1.1
Sample console app code – run against both versions of Oracle.ManagedDataAccess:
static void Main(string[] args)
{
var queries = new System.Collections.Generic.List<string>
{
{ "select 1.1 as value from dual" },
{ "select 1.10 as value from dual" },
{ "select 1.100 as value from dual" }
};
Oracle.ManagedDataAccess.Client.OracleConnection con = new Oracle.ManagedDataAccess.Client.OracleConnection(*** CONNECTION STRING ***);
try
{
con.Open();
foreach (string query in queries)
{
Oracle.ManagedDataAccess.Client.OracleCommand cmd = new Oracle.ManagedDataAccess.Client.OracleCommand
{
CommandText = query,
Connection = con
};
using (Oracle.ManagedDataAccess.Client.OracleDataReader dr = cmd.ExecuteReader())
{
if (dr.HasRows)
{
while (dr.Read())
System.Console.WriteLine(System.String.Format($"{query}\t = {dr["value"]}"));
}
}
}
}
finally
{
con.Close();
}
System.Console.ReadLine();
}
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
DECIMAL data type
When two decimal values are mixed in an expression, the scale and precision of the resulting value follow the rules shown in Scale...
Read more >Scale
Scale. This property specifies the number of decimal places to which Value property is resolved. ... Scale is used by parameters of type...
Read more >ConvertToPrecScale
The number of digits to the right of the decimal point. Range of scale is -84 to 127. Return Value. A new OracleDecimal...
Read more >The Oracle ManagedDataAccess Client is returning me ...
The Oracle ManagedDataAccess Client is returning me Decimal type for both number and number(38)/number(38, 0).
Read more >Which .NET data type is best for mapping the NUMBER ...
NET decimal and Oracle NUMBER maps a bit better than long and NUMBER and it also gives you more flexibility. If you at...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s scheduled to be in a release by April at the very latest.
Great - Does it have a planned release? We are upgrading to Oracle.ManagedDataAccess.Core but hit this issue and it’s not feasible to make the widespread code changes needed, so hoping this new config property will be included in that package too.
Will close this issue, thanks for your quick responses.