1

I'm using DataSets and DataTables with ODP.NET Oracle provider and I want to map oracle columns with type NUMBER(10) to Int32 instead of Int64. I found how to do it for EDM, but seems like this solution doesn't work for DataSets and DataTables https://docs.oracle.com/database/121/ODPNT/entityDataTypeMapping.htm. Also DevArt provider has NumberMapping collection property on OracleConnection class https://www.devart.com/dotconnect/oracle/docs/Devart.Data.Oracle~Devart.Data.Oracle.OracleConnection~NumberMappings.html, but it's commercial. Does anyone know how to change default types mapping between ODP.NET and DataSet?

  • Numbers up to ten digits may be as large at 10^10 - 1, which is greater than 2^32. What will you do with numbers of type number(10) that are too large to fit in an Int32? –  Aug 15 '16 at 12:25
  • Yeah, I know, but I have to do it due to some requirements. – Eugene Filimonov Aug 15 '16 at 13:32
  • I am not questioning whether you should do it or not; I am asking what the requirement is in that case. Or do you know that, in fact, the numbers will always be less than 2^32? (or, really, less than 2^31 - 1?) –  Aug 15 '16 at 14:13
  • Yes, I know in fact, that numbers will always be less than 2^32, but I can't modify database columns to NUMBER with less precision. – Eugene Filimonov Aug 15 '16 at 14:30
  • You can use a reader wrapper approach similar to answer to this question https://stackoverflow.com/questions/31619705/how-to-format-sql-server-datetimeoffset-and-move-to-oracle-using-oraclebulkcopy – Andrey Belykh Aug 23 '17 at 20:30

0 Answers0