IBM Books

Call Level Interface Guide and Reference

Converting Numeric SQL Data to C Data

The numeric SQL data types are:

SQL_DECIMAL
SQL_NUMERIC
SQL_SMALLINT
SQL_INTEGER
SQL_REAL
SQL_FLOAT
SQL_DOUBLE

Table 203. Converting Numeric SQL Data to C Data
fCType Test rgbValue pcbValue SQLSTATE
SQL_C_CHAR Display size < cbValueMax Data Length of data 00000
Number of significant digits < cbValueMax Truncated data Length of data 01004
Number of significant digits >= cbValueMax Untouched Length of data 22003
SQL_C_SHORT
SQL_C_LONG
SQL_C_FLOAT
SQL_C_DOUBLE
SQL_C_TINYINT
SQL_C_BIT

Data converted without truncation a Data Size of the C data type 00000
Data converted with truncation, but without loss of significant digits a Truncated data Size of the C data type 01004
Conversion of data would result in loss of significant digits a Untouched Size of the C data type 22003
Note:
a
The value of cbValueMax is ignored for this conversion. The driver assumes that the size of rgbValue is the size of the C data type.

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 ]