Friday, 21 November 2008

Compare SQL Server and Oracle Numeric Data Types

Number data types aren't so easy to directly compare. Oracle has one main data type, NUMBER, which is equivilent to SqlServer NUMERIC.

SQL Server Oracle
NUMERIC / DECIMAL Maximum precision of 38 digits NUMBER Maximum precision of 38 digits

SqlServer also has number data types that are sized in bytes not precision, which have no direct equivalent in Oracle.

Data TypeMinMaxBytesNear Oracle Equivalent
FLOAT-1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+3084 or 8BINARY_DOUBLE
REAL-3.40E+38 to -1.18E-38, 0 and 1.18E-38 to 3.40E+384BINARY_FLOAT

Oracle also has data types FLOAT, DECIMAL and INTEGER, however these are ANSI synonyms which refer back to the NUMBER data type with specific precisions.

See also: Compare Lob Data Types, Compare Character Data Types

No comments: