UNICODE Symbol Definition

ODBC Driver for Teradata® User Guide

brand
Teradata Tools and Utilities
prodname
ODBC Driver for Teradata
vrm_release
16.20
category
User Guide
featnum
B035-2526-108K

If an application is compiled with the UNICODE symbol defined, then calls to ODBC API functions are mapped to their corresponding W-functions through macro substitution in the sqlucode.h header file. For example, a call to SQLExecDirect is mapped to a call to SQLExecDirectW.

If the UNICODE symbol is undefined, then the application uses Unicode string arguments by explicitly calling W-functions.

Applications can be written to be compiled as either Unicode or ANSI applications. In that case, the character data type can be declared as SQL_C_TCHAR. This is done using a macro that inserts SQL_C_WCHAR if the application is compiled as a Unicode application (with UNICODE symbol defined), or inserts SQL_C_CHAR if compiled as an ANSI application. The application programmer must be careful of functions taking SQLPOINTER as an argument. In addition, the size of the length argument changes for string data types, depending on whether the application is ANSI or Unicode.

On Windows, definitions in the tchar.h include file are useful for applications built as Unicode or ANSI. Unicode definitions in tchar.h are controlled by the _UNICODE #define function (preceded by an underscore).

See the MSDN ODBC programmer's manual for additional information.