skip to main content
Supported data types : Oracle data types
 

Try DataDirect Cloud Now

Oracle data types

The following table shows how the Oracle data types are mapped to the standard data types for ODBC and JDBC.
Note: When the EnableWCharSupport connection parameter is set to true for the DataDirect Cloud Driver for ODBC, character types are mapped to the corresponding ODBC W-Types. For example, NCHAR types are mapped to the Unicode types SQL_WCHAR, SQL_WVARCHAR, and SQL_WLONGVARCHAR.
Table 12. Oracle data types
Oracle data type
JDBC data type
ODBC data type
BFile
BLOB
SQL_LONGVARBINARY(-4)
Binary_Double 1
DOUBLE
SQL_DOUBLE(8)
Binary_Float
REAL
SQL_REAL(7)
Blob
BLOB
SQL_LONGVARBINARY(-4)
Char
CHAR
SQL_WCHAR(-8) or SQL_CHAR(1)
Clob
CLOB
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)
Date
TIMESTAMP
SQL_TYPE_TIMESTAMP
Long
LONGVARCHAR
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)
Long Raw
LONGVARBINARY
SQL_LONGVARCHAR(-4)
NChar
CHAR
SQL_WCHAR(-8) or SQL_CHAR(1)
NClob
CLOB
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)
Number
DECIMAL
SQL_DECIMAL(3)
NVarChar2
VARCHAR
SQL_WVARCHAR(-9) or SQL_VARCHAR(12)
Raw
VARBINARY
SQL_VARBINARY(-3)
Timestamp 2
TIMESTAMP
SQL_TYPE_TIMESTAMP
Timestamp with Local Timezone 3
TIMESTAMP
SQL_TYPE_TIMESTAMP
Timestamp with Timezone 4
VARCHAR
SQL_WVARCHAR(-9) or SQL_VARCHAR(12)
UrowId
VARCHAR
SQL_WVARCHAR(-9) or SQL_VARCHAR(12)
VarChar
VARCHAR
SQL_WVARCHAR(-9) or SQL_VARCHAR(12)
VarChar2
VARCHAR
SQL_WVARCHAR(-9) or SQL_VARCHAR(12)
XMLType 5
CLOB
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)

1 Supported only on Oracle 10g and higher.

2 Supported only on Oracle 9i and higher.

3 Timestamp with timezone mapping changes based on the setting of the Fetch TSWTZ as Timestamp option only on Oracle 10g R2 and higher.

4 Timestamp with timezone mapping changes based on the setting of the Fetch TSWTZ as Timestamp option only on Oracle 10g R2 and higher.

5 Supported only on Oracle 9i R2 and higher.