Neoview ODBC Drivers Manual (R2.5)

Unicode also defines “wide” SQL data types. The following table lists the wide SQL data types
alongside the Neoview SQL column data types that correspond to them:
Description
Neoview SQL Column Data Type
(specified in CREATE TABLE command)SQL Unicode Type
Fixed length string, 1–32707 bytes;
number of characters depends on
national character set; length declared
in column definition
NCHARSQL_WCHAR
Variable length string, 1–32703 bytes;
number of characters depends on
national character set
NCHAR VARYINGSQL_WVARCHAR
For comprehensive information about Neoview SQL data types, see the Neoview SQL Reference
Manual.
A Unicode-enabled application can insert data of type SQL_C_CHAR or SQL_C_WCHAR into
a database column of type NCHAR or NCHAR VARYING, and can retrieve data from a column
of type CHAR, VARCHAR, or CHAR VARYING into a buffer of type SQL_C_CHAR or
SQL_C_WCHAR.
The Unicode driver also accepts calls to insert wide character data (SQL_C_WCHAR) into columns
of SQL types CHAR, VARCHAR, and CHAR VARYING, and calls to read data from wide
(NCHAR or NCHAR VARYING) columns into buffers of type SQL_C_CHAR. However,
translation errors and truncation can result in such cases.
For general information concerning Unicode data types, see the Microsoft Developer Network
Online Library at http://msdn.microsoft.com/en-us/library/ms709439(VS.85).aspx.
Unicode Driver Behavior
In most respects, the behavior of the HP Neoview Unicode driver is identical to that of the 32–bit
Windows driver described in Chapter 2 (page 31). The essential difference is in the degree of
character-set awareness:
Both drivers have the capability to translate SQL text and data based on the client locale
(character set) and the character-set configuration of the Neoview platform (ISO88591, SJIS,
or Unicode).
The Unicode driver assumes that arguments and data are encoded in UTF-8 by default.
Only the Unicode driver supports ODBC API functions that have the W (wide) suffix.
NOTE: For details about function mapping by the ODBC Driver Manager, see http://
msdn.microsoft.com/en-us/library/ms716540(VS.85).aspx
Only the Unicode driver supports Unicode data provided by an application through the
Driver Manager.
Translation of SQL statement text, input data, and output data depends on the character-set
configuration (ISO88591, SJIS, or Unicode) of the Neoview platform. However, the following
considerations apply, without regard to the character-set configuration:
On insertion, if character data presented by a Unicode-enabled application exceeds the size
of the database column, the Unicode driver truncates the data and reports an error to the
client.
On a fetch, if character data retrieved from the database exceeds the maximum length of the
client's data buffer, the Unicode driver truncates the data and reports an error to the client.
Error messages are in English. A Unicode application retrieves error messages in UTF-8
encoding in wide character buffers. An application that is not Unicode-enabled retrieves
error messages in the client locale in character buffers.
52 HP Neoview Unicode Driver for UNIX