Oracle For SQL Server Developers, Vol. 3

October 23, 2008

Here's another post in the Oracle For SQL Server Developers series (vol1, vol2).  The goal with this post is to help you get a feel for some common column data types in Oracle.

Tip #16: Data Type Equivalents for Numbers

SQL ServerOracle
intNUMBER
float, realNUMBER(precision, scale)

In Oracle, a number can be a maximum of 38 digits.  Precision indicates the number of digits on the left of the decimal point.  Scale indicates the number of digits on the right of the decimal point.

A cool thing in Oracle is that the Scale can be negative.  So if you have a NUMBER(7, -2) column and you insert 9231234.83 the value that will get stored is 9231200.  (Hint: that zeroed out the tens and singles column.)

Tip #17: Date Equivalents

SQL ServerOracle
datetimeDATE

Values can be from 1/1/4712 BC to 12/31/9999.  The standard format is DD-MON-YY and conversion can be done using the TO_DATE() function.

Tip #18: Binary Data Column Equivalent

SQL ServerOracle
imageBLOB

BLOB stores binary data (images, files, other raw data) and the maximum size is 128 terabytes.

Stay tuned.  There are at least 2 more posts coming in this Oracle For SQL Server Developers series!

-Ben

Categories: oracle
Tags: sql sql-server