When your application successfully
completes an attempt to connect to a
DB2® database
server, you should consider the following fields in the returned SQLCA:
- The second token in the SQLERRMC field (tokens are separated
by X'FF') indicates the code page of the database. The ninth
token in the
SQLERRMC field indicates the code page of the application. Querying
the application's
code page and comparing it to the database's code page informs
the
application
whether it has established a connection that will undergo character
conversions.
- The first and second entries in the SQLERRD array.
SQLERRD(1) contains
an integer value equal to the maximum expected expansion or contraction
factor
for the length of mixed character data (CHAR data types) when converted
to
the database code page from the application code page. SQLERRD(2)
contains
an integer value equal to the maximum expected expansion or contraction
factor
for the length of mixed character data (CHAR data types) when converted
to
the application code page from the database code page. A value of
0 or 1 indicates
no expansion; a value greater than 1 indicates a possible expansion
in
length; a negative value indicates a possible contraction.
The considerations for graphic string data should not be a factor
in unequal
code page situations. Each string always has the same number of characters,
regardless of whether the data is in the application or the database
code
page.