Data types and data conversion in DB2® UDB CLI functions

This topics shows all of the supported SQL types and their corresponding symbolic names.

Table 1 shows all of the supported SQL types and their corresponding symbolic names. The symbolic names are used in SQLBindParam(), SQLBindParameter(), SQLSetParam(), SQLBindCol(), and SQLGetData() to indicate the data types of the arguments.

Each column is described as follows:
SQL type
This column contains the SQL data type as it appears in an SQL statement. The SQL data types are dependent on the Database Management System (DBMS).
SQL symbolic
This column contains an SQL symbolic name that is defined (in sqlcli.h) as an integer value. This value is used by various functions to identify an SQL data type in the first column.
Table 1. SQL data types and default C data types
SQL type SQL symbolic
BIGINT SQL_BIGINT
BINARY SQL_BINARY
BLOB SQL_BLOB
CHAR SQL_CHAR, SQL_WCHAR1
CLOB SQL_CLOB
DATE SQL_DATE
DBCLOB SQL_DBCLOB
DECIMAL SQL_DECIMAL
DOUBLE SQL_DOUBLE
FLOAT SQL_FLOAT
GRAPHIC SQL_GRAPHIC
INTEGER SQL_INTEGER
NUMERIC SQL_NUMERIC
REAL SQL_REAL
SMALLINT SQL_SMALLINT
TIME SQL_TIME
TIMESTAMP SQL_TIMESTAMP
VARBINARY SQL_VARBINARY
VARCHAR SQL_VARCHAR, SQL_WVARCHAR1
VARGRAPHIC SQL_VARGRAPHIC
1
SQL_WCHAR and SQL_WVARCHAR can be used to indicate Unicode data.