When Making SQLColAttribute Calls - ODBC Driver for Teradata

ODBC Driver for Teradata User Guide

Product
ODBC Driver for Teradata
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-07-11
dita:mapPath
smj1488824663219.ditamap
dita:ditavalPath
Audience_PDF_product_legacy_odbc_include.ditaval
dita:id
B035-2526
lifecycle
previous
Product Category
Teradata Tools and Utilities

For an ANSI application (that is, compiled without UNICODE defined), the Driver Manager on the UNIX OS will not convert:

  • SQLColAttribute calls into SQLColAttributeW calls in ODBC Driver for Teradata
  • Output parameters from UTF-8 back to the application code page

Because of this, the output parameters from SQLColAttribute are delivered back to the ANSI application in the internal character set used by the driver. If the internal character set is different from the application code page, the application receives data back from SQLColAttribute in a different character set from what was expected.

This is a problem if, for example, an ANSI application using ISO 8859-1 requests non-ASCII meta data (such as a column name with Danish characters) and the session character set is UTF-8. The application gets the column name back in UTF-8. In general, if an ANSI application uses a Unicode session character set, it gets data back from SQLColAttribute in UTF-8, regardless of the application code page.

To avoid this problem, use the old SQLColAttributes function (with an 's' at the end).