Page 1 of 1

Datatype inconsistency

Posted: Wed 18 Jul 2012 14:00
by Yoke78
Hello,

I used the following page to map c# numbers with oracle numbers :
http://www.devart.com/dotconnect/oracle ... pping.html

In part "Oracle to .NET type mapping", it's said that NUMBER(2)..NUMBER(9) maps with int32
In part ".NET to Oracle default type mapping", it's said that int32 maps with number(10)

Number(10) has to be used to be able to store int32 max value, but the column is then considered by the provider as an int64, which leads to a cast issue in my application.
I used the mapping override OracleConnection.NumberMappings to fix my problem, but you should probably have a look at this.

Thanks,
Yoann

Re: Datatype inconsistency

Posted: Fri 20 Jul 2012 09:41
by Shalex
That is because any Int32 value can be stored in the NUMBER(10) column, but largest NUMBER(10) column value cannot be stored in the Int32 field, it requires Int64 field.

Re: Datatype inconsistency

Posted: Fri 20 Jul 2012 09:57
by Yoke78
Hello,

Thanks for the explanation, that make sense.
I guess depending on how data are accessed/stored, this constraint is needed or not.

Yoann