Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Arithmetic operation resulted in an overflow / Specified cast is not valid.

Patrick KernFeb 20 2024

Hi,

we use "Oracle.ManagedDataAccess.Core" Version="23.3.1-dev" with Oracle DB 19c.

when we retrieve an UDT-Property (DB Type NUMBER, Value ="15,0003898635477582846003898635477582846") an excpetion “Arithmetic operation resulted in an overflow” occurs (call stack: Oracle.ManagedDataAccess.Types.DecimalConv.GetDecimal
Oracle.ManagedDataAccess.dll!OracleInternal.UDT.Types.UDTNumberType.GetCustomValue)

when we retrive the same value via ExecuteScalar (COMMAND: “select 96.19 /641.25 * 100 res from dual”) the exception Specified cast is not valid occurs (call stack: OracleInternal.ServiceObjects.OracleFailoverMgrImpl.OnError)

we know that Oracle Number has a greater precision than .NET Decimal.

we used DevArt dot Connect for Oracle so far. It seems, that this provider cut/truncate the value at precision ~18. the provider does not throw an exception, it return the cutted decimal object.

is there an option/setting we can set at odp provider level to control the behaviour of retrieving numbers with an higher precision?

our code/application is very huge, so we cant take care of all numeric/math operations.

thanks

This post has been answered by Alex Keh-Oracle on Jun 1 2024
Jump to Answer

Comments

Post Details

Added on Feb 20 2024
18 comments
557 views