Neoview ODBC Drivers Manual (R2.5)

4 HP Neoview Unicode Driver for UNIX
The HP Neoview Unicode driver allows an application to provide and retrieve Unicode data
using an ODBC interface for access to the Neoview database. The driver translates as necessary
between the client character set (locale) and the character encoding in the database.
Applications that are not Unicode-enabled also work with Unicode driver. In such cases, the
Unicode driver provides functionality identical to that of the 32–bit ANSI driver described in
Chapter 2 (page 31).
NOTE: Once an application has used either a Unicode or an ANSI API, it is committed to
continue in that mode. Subsequently invoking the other API type results in an error. You cannot
mix Unicode and ANSI APIs in one application.
For general information about Unicode and Unicode data types, see the Microsoft Developer
Network Online Library at http://msdn.microsoft.com/en-us/library/ms709439(VS.85).aspx.
For information about character and wide character types in Unicode, see “Unicode C and SQL
Data Types” (page 51).
The Neoview platform supports any of the following character-set configurations:
ISO88591
SJIS
Unicode
The format in which a data item is encoded in the Neoview SQL database depends on several
factors: the client locale (for example, Chinese), the data type of the client buffer (for example
SQL_C_CHAR), the data type of the database column (for example NCHAR VARYING), and
the underlying character-set configuration (for example Unicode). This encoding should be
transparent to the application.
For comprehensive information about international character sets on Neoview, please consult
the HP Neoview Character Sets Administrator's Guide.
Unicode APIs
Unicode versions of standard ODBC APIs use “wide” function calls. The character W appended
to the name indicates the “wide”, or Unicode function call.
Some ODBC API functions, for example SQLBindParameter , let you declare the data type of the
argument in the function call. Such functions do not have different versions for Unicode and
ANSI.
For more information about specific functions that have Unicode versions, refer to the Microsoft
Developer Online Library at http://msdn.microsoft.com/en-us/library/ms716246(VS.85).aspx.
Unicode C and SQL Data Types
A Unicode-enabled application can declare a character buffer to be of either of the following
types:
SQL_C_CHAR (character data)
SQL_C_WCHAR (“wide” character data)
In addition, the SQLUCODE.H header file includes a define for SQL_C_TCHAR, which is
equivalent to SQL_C_CHAR for a non-Unicode application and to SQL_C_WCHAR for a
Unicode-enabled application, depending on compiler flags you set.
Unicode APIs 51