INFORMIX
Informix Guide to GLS Functionality
Chapter 6: INFORMIX-SE Features
Home Contents Index Master Index New Book

Using the Server Locale

The SE database server creates operating-system files for the following objects:

    When SE creates a database, it creates a subdirectory that is called dbname.dbs in your current directory.

    When you create a table in a database, SE creates two files, a data file (.dat) and an index file (.idx). SE stores the data and index files that are associated with a database in the dbname.dbs subdirectory.

    SE creates this file when you specify the WITH LOG IN clause of the CREATE DATABASE statement.

Tip: For more information on database, table, and index files, see the "INFORMIX-SE Administrator's Guide." For more information on the dbexport utility, see the "Informix Migration Guide."
These operating-system files reside on the server computer, the same computer on which SE resides. When SE reads from or writes to these files, it must use a code set that the server computer supports. SE obtains this code set from the server locale. You set the server locale with the SERVER_LOCALE environment variable. If you do not set SERVER_LOCALE, SE uses the default locale, U.S. English, as the server locale. For the definition of server locale, see page 1-27. For information on how to set SERVER_LOCALE, see page 2-41.

SE needs to determine the code set that the server locale supports (the server code set) to perform the following tasks that are associated with the read/write operations to its operating-system files:

Generating Non-ASCII Filenames

When you specify the name of a database, table, or index, SE creates a file that includes the identifier name. When you create a database log file, SE creates a file with the specified name. The following restrictions affect the ability of SE to generate filenames that contain non-ASCII characters:

The GLS8BITFSYS Environment Variable

The GLS8BITFSYS environment variable on the server computer tells the SE database server whether the operating system is 8-bit clean. SE uses the value of GLS8BITFSYS to determine whether it can use non-ASCII characters in the filename of an operating-system file that it generates, as follows:

For example, suppose you create an SE database that is called A1A2B1B2, where A1A2 and B1B2 are multibyte characters, with the following SQL statement:

Tip: For more information about how to use multibyte characters in the name of an SE database, see "Naming a Database".
If GLS8BITFSYS is 1 (or is not set) on the server computer, SE assumes that the operating system is 8-bit clean, and it generates a database directory, A1A2B1B2.dbs. For more information on an 8-bit clean operating system and the GLS8BITFSYS environment variable, see page 2-23.

The Server Code Set

When SE actually creates a file whose filename has non-ASCII characters, the server locale must support these non-ASCII characters. Before you start SE, you must set the SERVER_LOCALE environment variable to the name of a locale whose code set contains these non-ASCII characters.

For example, suppose you want an SE message log with the path C1C2D1D2D3, where C1C2 and D1D2D3 are multibyte characters in the Japanese SJIS code set. You must perform the following steps to enable SE to create this message-log file from within a client application:

    1. Set the SERVER_LOCALE environment variable on the server computer to the Japanese SJIS locale, ja_jp.sjis.

    2. Set the CLIENT_LOCALE environment variable on the client computer to the Japanese SJIS locale, ja_jp.sjis, or to a locale that supports a convertible code set. For more information, see "Performing Code-Set Conversion".

    3. Start up the client application from which you execute the following SQL statement: CREATE DATABASE A1A2B1B2 WITH LOG IN 'C1C2D1D2D3'

When SE executes this CREATE DATABASE statement, it can support the Japanese SJIS characters in the database name and the message-log file. For more information on CREATE DATABASE, see the Informix Guide to SQL: Syntax.

Data Portability

Use of non-ASCII characters for SE database names and table names might present compatibility problems. To achieve maximum portability for SE, Informix recommends that you not use non-ASCII database names, so that you retain the option to shift the database to an operating system that is not 8-bit clean. To disable the capability of SE to generate 8-bit filenames (even if the operating system is 8-bit clean), set the GLS8BITFSYS environment variable to 0.

Performing Code-Set Conversion

Once SE creates the operating-system file, it has generated a filename and written file contents in the code set of the server locale (the server code set). Any Informix product or client application that needs to access this file must have a server-processing locale that supports this same server code set. You must ensure that the appropriate locale environment variables are set so that the server-processing locale supports a code set with these non-ASCII characters. (For more information on the server-processing locale, see page 1-34.)

SE checks the validity of a filename with respect to the server-processing locale before it references a filename. When SE transfers data to and from its operating-system files, it handles any differences in the code sets of the server-processing locale and the server locale as follows:

    If SE reads from or writes to an operating-system file for which no code-set conversion exists, it uses the code set of the server-processing locale to perform the read or write operation.

For more information on code-set conversion, see page 1-40.




Informix Guide to GLS Functionality, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.