DB2 UDB / ODBC-supported datatypes

Table B-3 identifies the supported DB2 UDB datatypes and their related ODBC datatypes.

Table B-3: Supported DB2 UDB datatypes and related ODBC datatypes

DB2 UDB datatypes

ODBC datatypes

CHAR

SQL_CHAR(1)

CHAR () (for bit data)

SQL_BINARY(-2)

DATE

SQL_TYPE_DATE(91)

DECIMAL

SQL_DECIMAL(3)

DOUBLE

SQL_DOUBLE(8)

FLOAT

SQL_FLOAT(6)

FLOAT (4)

SQL_REAL(7)

INTEGER

SQL_INTEGER(4)

*CLOB

SQL_LONGVARCHAR(-1)

LONG VARCHAR

SQL_LONGVARCHAR(-1)

*BLOB

SQL_LONGVARBINARY(-4)

LONG VARCHAR () (for bit data)

SQL_LONGVARBINARY(-4)

NUMERIC

SQL_NUMERIC(2)

SMALLINT

SQL_SMALLINT(5)

TIME

SQL_TYPE_TIME(92)

TIMESTAMP

SQL_TYPE_TIMESTAMP(93)

VARCHAR

SQL_VARCHAR(12)

VARCHAR () (for bit data)

SQL_VARBINARY(-3)

* Results sets containing these datatypes are truncated to 32,768 bytes.