News

Map Oracle Datatypes to .NET Datatypes

2007-05-08 14:50:02 by Kjell-Åke Gafvelin

In my current project we have been using Oracle as a database. And we have been quite sloppy with defining the correct datatypes for integers and decimals, we have just been using the Oracle datatype NUMBER without specifying precision or scale for both. So I thougth I would create a list with the correct values for precision and scale for integer, decimal, single e.t.c.

  • Int16 = NUMBER(4,0)
  • Int32 = NUMBER(9,0)
  • Int64 = NUMBER(18,0)
  • Single = NUMBER( < 8, < 44)
  • Double = NUMBER( < 16, *)
  • Decimal = NUMBER(*,*)

|