728x90

Determine the server-processing locale

The database server uses the server-processing locale to obtain locale information for its own internal sessions and for any connections.

When the database server begins execution, it initializes the server-processing locale to the default locale. When a client application requests a connection, the database server must redetermine the server-processing locale to include the client and database locales. The database server uses the server-processing locale to obtain locale information that it needs when it transfers data between the client system and the database.

After the IBM® Informix® database server verifies the database locale, it uses a precedence of environment variables from the client and database locales to set the server-processing locale.

The database server obtains the following information from the server-processing locale:
  • Locale information for the database

    This database information includes the localized order and code set for data in columns with the locale-sensitive data types (NCHAR and NVARCHAR). The database server obtains this information from the name of the database locale that it has verified.

  • Locale information for client-application data

    This client-application information provides the end-user formats for date, time, numeric, and monetary data. The database server obtains this information from the client application when the client requests a connection.

The following figure shows the relationship between the client locale, database locale, server locale, and server-processing locale.
Figure 1. The server-processing locale
begin figure description - This figure is described in the surrounding text. - end figure description
Tip: The database server uses the server locale, as specified by the SERVER_LOCALE environment variable, for read and write operations on its own operating-system files. For information about operating-system files, see GLS support by IBM Informix database servers.


Locale information for the database

The database server must know how to interpret the data in any columns with the locale-specific data types, NCHAR and NVARCHAR.

To handle this locale-specific data correctly, the database server must know the localized order for the collation of the data and the code set of the data. In addition, the database server uses the code set of the database locale as the code set of the server-processing locale.

The database server might have to perform code-set conversion between the code sets of the server-processing locale and the server locale. For more information, see Perform code-set conversion.

The database server uses the following precedence to determine this database information:
  1. The locale that the database server uses to determine the database information for the server-processing locale depends on the state of the database to which the client application requests a connection, as follows:
    1. For a connection to an existing database, the database server uses the database information from the database locale that it obtains when it verifies the database locale. If the client application does not send DB_LOCALE, the database server uses the DB_LOCALE that is set on the server computer.
    2. For a new database, the database server uses the DB_LOCALE, which the client application has sent.
  2. The locale that the DB_LOCALE environment variable on the server computer indicates
  3. The default locale (U.S. English)

IBM® Informix® uses the precedence of steps 1, 2, and 3 in the preceding list to obtain the database information for the server-processing locale. You are not required to set the other environment variables.

Tip: The precedence rules apply to how the database server determines both the COLLATION category and the CTYPE category of the server-processing locale. For more information about these locale categories, see Locale categories.

For more information about how the database server obtains these environment variables, see Send the client locale.

If the client application makes another request to open a database, the database server must reestablish the database information for the server-processing locale, as follows:
  1. Reverify the database locale by comparing the database locale in the database to be opened with the value of the DB_LOCALE environment variable from the client application.
  2. Reestablish the server-processing locale with the newly verified database locale (from the preceding step).

For example, suppose that your client application has DB_LOCALE set to en_us.8859-1 (U.S. English with the ISO8859-1 code set). The client application then opens a database with the U.S. English locale (en_us.8859-1), and the database server establishes a server-processing locale withen_us.8859-1 as the locale that defines the database information.

If the client application now closes the U.S. English database and opens another database, one with the French locale (fr_fr.8859-1), the database server must reestablish the server-processing locale. The database server sets the eighth character field of the SQLWARN array to W indicate that the two locales are different. The client application, however, might choose to use this connection because both these locales support the ISO8859-1 code set. If the client application opens a database with the Japanese SJIS locale (ja_jp.sjis) instead of one with a French locale, your client application would probably not continue with this connection because the locales are too different.

http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.glsug.doc/ids_gug_050.htm#ids_gug_050

http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.glsug.doc/ids_gug_051.htm

728x90

'Informix > informix reference' 카테고리의 다른 글

Uninstalling ISM  (0) 2011.10.24
Setting Up ISM on UNIX  (0) 2011.10.24
How to use oncheck to detect corruption  (0) 2011.10.10
Informix Continuing Support Offering  (0) 2011.10.06
The archecker Schema Reference  (0) 2011.08.31

+ Recent posts