Data conversion in Db2 for i CLI functions
Db2 for i call level interface (CLI) manages the transfer and any required conversion of data between the application and the Database Management System (DBMS).
Before the data transfer actually takes place, the source, target
or both data types are indicated when calling SQLBindParam(), SQLBindParameter(), SQLSetParam(), SQLBindCol() or SQLGetData().
These functions use the symbolic type names shown in Table 1, to identify
the data types involved. See SQLFetch - Fetch next row,
or SQLGetCol - Retrieve one column of a row of the result set for examples of the functions
that use the symbolic data types.
For a list of supported data type conversions in Db2 for i CLI, see the data type compatibility table in Assignments and comparisons. Other conversions can be achieved by using SQL scalar functions or the SQL CAST function in the SQL syntax of the statement being processed.
The functions mentioned in the previous paragraph can be used to convert data to other types. Not all data conversions are supported or make sense.
Whenever truncation that is rounding or data type incompatibilities
occur on a function call, either SQL_ERROR or SQL_SUCCESS_WITH_INFO
is returned. Further information is then indicated by the SQLSTATE
value and other information returned by SQLError().