Specifying the client code page for Unicode support of Microsoft SQL Server and ODBC data sources

To ensure correct code page conversion for Microsoft SQL Server and ODBC data sources, you must specify the client code page if the code page differs from the federated database code page.

Procedure

To specify the client code page, issue a CREATE SERVER statement with the CODEPAGE option set to the value of the client code page.

The client code page is the code page of the data source. The value of the client code page is the code page number.

Example: If the data source is Microsoft SQL Server and the federated server is on Windows and the default system locale of the operating system is set to Japanese (Shift-JIS), the CODEPAGE server option must be set to either 943 (Shift-JIS) or 1202 (UTF-16LE). To specify the 1202 code page for the Microsoft SQL server data source named FEDSERVERW, issue the following statement:
CREATE SERVER FEDSERVERW TYPE MSSQLSERVER VERSION 2000 WRAPPER MSSQLODBC3 
       OPTIONS(NODE 'SAMPLE', DBNAME 'TESTDB', CODEPAGE '1202');

Example: If the data source is Microsoft SQL Server and the federated server is running on UNIX and the IANAAppCodePage setting of the DataDirect Connect client is 6 (Shift-JIS), the CODEPAGE server option must be set to either 943 (Shift-JIS) or 1208 (UTF-8).

If IANAAppCodePage is not set in db2dj.ini, the ODBC driver will not perform code page conversion. The character stream is passed directly to the federation server. In this case, CODEPAGE should be set to the same as the code page of the data source. The default IANAAppCodePage is 4(ISO 8859-1 Latin-1).

To specify the 1208 code page for the Microsoft SQL server data source named FEDSERVERU, issue the following statement:
CREATE SERVER FEDSERVERU TYPE MSSQLSERVER VERSION 2000 WRAPPER MSSQLODBC3 
       OPTIONS(NODE 'SAMPLE', DBNAME 'TESTDB', CODEPAGE '1208');