Oracle7 Server Application Developer's Guide

Contents Index Home Previous Next

ANSI/ISO, DB2, and SQL/DS Datatypes

In addition to Oracle datatypes, you can define columns of tables in an Oracle database using ANSI/ISO, DB2, and SQL/DS datatypes. However, Oracle internally converts such datatypes to Oracle datatypes. The ANSI datatype conversions to Oracle datatypes are shown in Table 5 - 3; Table 5 - 4 shows the DB2 and SQL/DS conversions.

ANSI SQL Datatype Oracle Datatype
CHARACTER (n), CHAR (n) CHAR (n)
NUMERIC (p,s), DECIMAL (p,s), DEC (p,s) NUMBER (p,s)
INTEGER, INT, SMALLINT NUMBER (38)
FLOAT (p) FLOAT (p)
REAL FLOAT (63)
DOUBLE PRECISION FLOAT (126)
CHARACTER VARYING(n), CHAR VARYING(n) VARCHAR2 (n)
Table 5 - 3. ANSI Datatype Conversions to Oracle Datatypes

DB2 or SQL/DS Datatype Oracle Datatype
CHARACTER (n) CHAR (n)
VARCHAR (n) VARCHAR2 (n)
LONG VARCHAR LONG
DECIMAL (p,s) NUMBER (p,s)
INTEGER, SMALLINT NUMBER (38)
FLOAT (p) FLOAT (p)
DATE DATE
Table 5 - 4. SQL/DS, DB2 Datatype Conversions to Oracle Datatypes

The IBM products SQL/DS, and DB2 datatypes TIME, TIMESTAMP, GRAPHIC, VARGRAPHIC, and LONG VARGRAPHIC have no corresponding Oracle datatype and cannot be used. The TIME and TIMESTAMP datatypes are subcomponents of the Oracle datatype DATE.

The ANSI/ISO datatypes NUMERIC, DECIMAL, and DEC can specify only fixed-point numbers. For these datatypes, s defaults to 0.


Contents Index Home Previous Next