IBM Books

Call Level Interface Guide and Reference

Converting Character C Data to SQL Data

The character C data type is:

SQL_C_CHAR


Table 209. Converting Character C Data to SQL Data
fSQLType Test SQLSTATE
SQL_CHAR
SQL_VARCHAR
SQL_LONGVARCHAR
SQL_CLOB

Length of data <= Column length 00000
Length of data > Column length 22001
SQL_DECIMAL
SQL_NUMERIC
SQL_SMALLINT
SQL_INTEGER
SQL_REAL
SQL_FLOAT
SQL_DOUBLE

Data converted without truncation 00000
Data converted with truncation, but without loss of significant digits 22001
Conversion of data would result in loss of significant digits 22003
Data value is not a numeric value 22005
SQL_BINARY
SQL_VARBINARY
SQL_LONGVARBINARY
SQL_BLOB

(Length of data) < Column length N/A
(Length of data) >= Column length 22001
Data value is not a hexadecimal value 22005
SQL_DATE Data value is a valid date 00000
Data value is not a valid date 22007
SQL_TIME Data value is a valid time 00000
Data value is not a valid time 22007
SQL_TIMESTAMP Data value is a valid timestamp 00000
Data value is not a valid timestamp 22007
SQL_GRAPHIC
SQL_VARGRAPHIC
SQL_LONGVARGRAPHIC
SQL_DBCLOB

Length of data / 2 <= Column length 00000
Length of data / 2 < Column length 22001

Note:SQLSTATE 00000 is not returned by SQLError(), rather it is indicated when the function returns SQL_SUCCESS.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]