Data types and data conversion in DB2 for i CLI functions

The table 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.
Start of change
Table 1. SQL data types and SQL symbolic names
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
DECFLOAT(7)2 SQL_DECFLOAT
DECFLOAT(16) SQL_DECFLOAT
DECFLOAT(34) SQL_DECFLOAT
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
XML SQL_XML
1
SQL_WCHAR and SQL_WVARCHAR can be used to indicate Unicode data.
2
Note that there is no DECFLOAT(7) data type. However, DB2® will accept this data type from applications.
End of change