Datatype inconsistency

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Yoke78
Posts: 4
Joined: Fri 13 Jul 2012 09:27

Datatype inconsistency

Post by Yoke78 » Wed 18 Jul 2012 14:00

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

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: Datatype inconsistency

Post by Shalex » Fri 20 Jul 2012 09:41

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.

Yoke78
Posts: 4
Joined: Fri 13 Jul 2012 09:27

Re: Datatype inconsistency

Post by Yoke78 » Fri 20 Jul 2012 09:57

Hello,

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

Yoann

Post Reply