Data Types for DB2 under UNIX and PC Hosts

The following table lists the data type support for a DB2 database under UNIX and PC hosts.
The NCHAR, NVARCHAR, and TINYINT data types are not supported for data type definition.
For data source specific information about the DB2 database data types, see the DB2 database documentation.
Data Types for DB2 under UNIX and PC Hosts
Data Type Definition Keyword1
DB2 Data Type
Description
Data Type Returned
BIGINT
BIGINT
Large signed, exact whole number.
BIGINT
BINARY(n)
CHAR(n) FOR BIT DATA
Fixed-length binary string.
BINARY(n)
BLOB(n[K|M|G])
Varying-length binary large object string.
CHAR(n)
CHAR(n)
Fixed-length character string.
CHAR(n)
CLOB(n[K|M|G] )
Varying-length character large object string.
DATE
DATE
Date values.
DATE
DBCLOB(n[K|M|G])
Varying-length double-byte character large object.
DECIMAL|NUMERIC(p,s)
DECIMAL|NUMERIC(p,s)
Signed, fixed-point decimal number.
DECIMAL|NUMERIC(p,s)
DOUBLE
DOUBLE
Signed, double precision, floating-point number.
DOUBLE
FLOAT(p)
FLOAT(p)
Signed, single precision or double precision, floating-point number.
FLOAT(p)
GRAPHIC(n)
Fixed-length graphic string.
INTEGER
INTEGER
Regular signed, exact whole number.
INTEGER
LONG VARCHAR [FOR BIT DATA]
Varying-length character or binary string.
LONG VARGRAPHIC(n)
Varying-length graphic string.
REAL
REAL
Signed, single precision, floating-point number.
REAL
SMALLINT
SMALLINT
Small signed, exact whole number.
SMALLINT
TIME(p)
TIME(p)
Time value.
TIME(p)
TIMESTAMP(p)
TIMESTAMP(p)
Date and time value.
TIMESTAMP(p)
VARBINARY(n)
VARCHAR(n) FOR BIT DATA
Varying-length binary string.
VARBINARY(n)
VARCHAR(n)
VARCHAR(n)
Varying-length character string.
VARCHAR(n)
VARGRAPHIC(n)
Varying-length graphic string
1The CT_PRESERVE= connection argument, which controls how data types are mapped, can affect whether a data type can be defined. The values FORCE (default) and FORCE_COL_SIZE do not affect whether a data type can be defined. The values STRICT and SAFE can result in an error if the requested data type is not native to the data source, or the specified precision or scale is not within the data source range.
2The DB2 data type cannot be defined, and when data is retrieved, the native data type is mapped to a similar data type.