IBM Books

Call Level Interface Guide and Reference


Conversion Function

The conversion function is supported by DB2 CLI and defined by ODBC using vendor escape clauses.

Each driver and datasource determines which conversions are valid between the possible data types. As the driver translates the ODBC syntax into native syntax it will reject the conversions that are not supported by the data source, even if the ODBC syntax is valid.

Use the function SQLGetInfo() with the appropriate convert function masks to determine which conversions are supported by the data source.


Table 193. Conversion Function

CONVERT( expr_value, data_type )

  • data_type indicates the data type of the converted representation of expr_value, and can be either SQL_CHAR or SQL_DOUBLE.

  • expr_value is the value to convert. It can be of various types, depending on the conversions supported by the driver and datasource. Use the function SQLGetInfo() with the appropriate convert function masks to determine which conversions are supported by the data source.

(When moving from a v2.1.0 to a v2.1.1 database you must run the migrate utility to access this function.)


DB2 for common server 2.1



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

[ DB2 List of Books | Search the DB2 Books ]