Data types and data conversion

When you write a Db2 ODBC application, you must work with both SQL data types and C data types. The database server uses SQL data types, and the application uses C data types.

The application must therefore match C data types to SQL data types when transferring data between the database server and the application (when calling Db2 ODBC functions).

To help address this, Db2 ODBC provides symbolic names for the various data types, and manages the transfer of data between the database server and the application. It also performs data conversion (from a C character string to an SQL INTEGER type, for example) if required. To accomplish this, Db2 ODBC needs to know both the source and target data type. This requires the application to identify both data types using symbolic names.