Administration Guide

Deriving Code Page Values

The application code page is derived from the active environment when the database connection is made. If the DB2CODEPAGE registry variable is set, its value is taken as the application code page. However, it is not necessary to set the DB2CODEPAGE registry variable, because DB2 will determine the appropriate code page value from the operating system. Setting the DB2CODEPAGE registry variable to incorrect values may cause unpredictable results.

The database code page is derived from the value specified (explicitly or by default) at the time the database is created. For example, the following defines how the active environment is determined in different operating environments:

UNIX
On UNIX based operating systems, the active environment is determined from the locale setting, which includes information about language, territory and code set.

OS/2
On OS/2, primary and secondary code pages are specified in the CONFIG.SYS file. You can use the chcp command to display and dynamically change code pages within a given session.

Macintosh
For the Macintosh operating system, if the DB2CODEPAGE registry variable is not set, the Macintosh code page is derived from the Regional version code from the installed script.

Windows
For the Windows operating system, if the DB2CODEPAGE registry variable is not set, the Windows code page is derived from the country ID, as specified in the iCountry value in the [intl] section of the Windows WIN.INI file.

Windows 32-bit operating systems
For all Windows 32-bit operating systems, if the DB2CODEPAGE registry variable is not set, the code page is derived from the ANSI code page setting in the Registry.

For a complete list of environment mappings for code page values, see Table 91.


[ Top of Page | Previous Page | Next Page ]