Call Level Interface Guide and Reference
For a given SQL data type:
- the first column of the table lists the legal input values of the
fCType argument in SQLBindCol() and
SQLGetData().
- the second column lists the outcomes of a test, often using the
cbValueMax argument specified in SQLBindCol() or
SQLGetData(), which the driver performs to determine if it can
convert the data.
- the third and fourth columns list the values (for each outcome) of the
rgbValue and pcbValue arguments specified in the
SQLBindCol() or SQLGetData() after the driver has
attempted to convert the data.
- the last column lists the SQLSTATE returned for each outcome by
SQLFetch(), SQLExtendedFetch(), SQLGetData()
or SQLGetSubString().
The tables list the conversions defined by ODBC to be valid for a given SQL
data type.
If the fCType argument in SQLBindCol() or
SQLGetData() contains a value not shown in the table for a given
SQL data type, SQLFetch(), or SQLGetData() returns the
SQLSTATE 07006 (Restricted data type attribute violation).
If the fCType argument contains a value shown in the table but
which specifies a conversion not supported by the driver,
SQLFetch(), or SQLGetData() returns SQLSTATE HYC00
(Driver not capable).
Though it is not shown in the tables, the pcbValue argument
contains SQL_NULL_DATA when the SQL data value is NULL. For an explanation of
the use of pcbValue when multiple calls are made to retrieve data,
see SQLGetData().
When SQL data is converted to character C data, the character count
returned in pcbValue does not include the null termination byte. If
rgbValue is a null pointer, SQLBindCol() or
SQLGetData() returns SQLSTATE HY009 (Invalid argument value).
In the following tables:
- Length of data
- the total length of the data after it has been converted to the specified
C data type (excluding the null termination byte if the data was converted to
a string). This is true even if data is truncated before it is returned to the
application.
- Significant digits
- the minus sign (if needed) and the digits to the left of the decimal
point.
- Display size
- the total number of bytes needed to display data in the character format.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]