question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decimal scale change between Oracle.ManagedDataAccess v19.6 and 19.7

See original GitHub issue

There 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexkehcommented, Jan 15, 2021

It’s scheduled to be in a release by April at the very latest.

0reactions
jasonwnzcommented, Jan 15, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found