The SQL type parameter (the fifth parameter) for
SQLBindParameter describes the data type on the database server. The ODBC Driver Manager must not change this for the UNICODE or the ANSI types. The ODBC Driver Manager handles the mapping for C data types (that is, the SQL_C_
XXXX types), depending on the nature of the driver (ANSI or UNICODE) and data on the client side. However, the ODBC Driver Manager does not handle the mapping for the SQL data types (that is, the SQL_
XXXX types).
To work around this design feature, use one of the following methods:
- Have the application use the SQLDescribeParam or the SQLDescribeCol function to discover the SQL type of the parameter or the column respectively, and then adjust the SQL type parameter accordingly.
- Have the driver internally convert to the SQL type that you want.
Because the ODBC Driver Manager must work for all drivers, the ODBC Driver Manager cannot map the SQL type.