![]() |
|
This section lists the GLS-related environment variables that you can set for Informix database servers and SQL API products.
Informix Gateway products on UNIX use the GL_PATH environment variable to override the default locations for GLS code-set conversion tables. For details, see the Enterprise Gateway documentation.
The value of the CC8BITLEVEL environment variable determines the type of processing that the ESQL/C filter, esqlmf, performs on non-ASCII (8-bit and multibyte) characters. For information about esqlmf, see Generating Non-ASCII Filenames.
To invoke esqlmf each time that you process an ESQL/C file with the esql command, set the ESQLMF environment variable to 1. If you do not set CC8BITLEVEL, the esql command assumes a value for CC8BITLEVEL of 0.
Important: For ESQLMF to take effect, do not set CC8BITLEVEL to 3.
CLIENT_LOCALE
The CLIENT_LOCALE environment variable specifies the client locale, which the client application uses to perform read and write operations, as well as for other uses such as determining end-user formats and processing ESQL statements. For information about the client locale, see The Client Locale.
A sample nondefault client locale for a French-Canadian locale follows:
You can use the glfiles utility to generate a list of the GLS locales that are available on your UNIX system. For more information, see The glfiles Utility.
If you do not set CLIENT_LOCALE, the client application uses the default locale, U.S. English, as the client locale.
Changes to CLIENT_LOCALE also enter in the Windows NT registry database under HKEY_LOCAL_MACHINE.
Informix products support DBDATE for compatibility with earlier products. Informix recommends that you use the GL_DATE environment variable for new applications.
The DBDATE environment variable specifies the end-user formats of values in DATE columns. For information about end-user formats, see End-User Formats.
Important: DBDATE is evaluated at system initialization time. If it is invalid, the system initialization fails.
Important: The setting of the DBDATE variable takes precedence over that of the GL_DATE environment variable, as well as over the default DATE formats that CLIENT_LOCALE specifies.
DBLANG
The DBLANG environment variable specifies the subdirectory of INFORMIXDIR that contains the customized, language-specific message files that an Informix product uses.
Informix products locate product-specific message files in the following order:
The compiled message files have the .iem file extension.
The DB_LOCALE environment variable specifies the database locale, which the database server uses to handle locale-sensitive data types (NCHAR, NVARCHAR) of the database. For information about the database locale, see The Database Locale.
A sample nondefault database locale for a French-Canadian locale follows:
You can use the glfiles utility to generate a list of the GLS locales that are available on your UNIX system. For more information, see The glfiles Utility.
For client applications, if you do not set DB_LOCALE on the client computer, the client applications assume that the database locale is the value of the CLIENT_LOCALE environment variable. However, the client application does not send this assumed value to the database server when it requests a connection.
Changes to DB_LOCALE also enter in the Windows NT registry database under HKEY_LOCAL_MACHINE.
The DBMONEY environment variable specifies the end-user formats for values in MONEY columns. For information about end-user formats, see End-User Formats.
With this environment variable, you can set the following currency notation:
For example, suppose you set DBMONEY as follows:
This value sets the following currency notation:
In the default locale, the currency symbol is the dollar sign ($), and it appears at the front of the monetary values. The period (.) is the decimal separator, and the comma (,) is the thousands separator. The currency notation that you specify with DBMONEY takes precedence over the currency notation that the locale defines. For more information, see Customizing Monetary Values.
Informix products support DBTIME for compatibility with earlier products. Informix recommends that you use the GL_DATETIME environment variable for new applications.
The DBTIME environment variable specifies the end-user formats of values in DATETIME columns for SQL API routines. For information about end-user formats, see End-User Formats.
Tip: The DBTIME environment variable affects only certain DATETIME and INTERVAL formatting routines in the ESQL/C function libraries. For information about how these library functions are affected, refer to DATETIME-Format Functions.
ESQLMF
The ESQLMF environment variable indicates whether the esql command automatically invokes the ESQL/C multibyte filter, esqlmf.
The value of the CC8BITLEVEL environment variable determines the type of filtering that esqlmf performs. For information about esqlmf, see Generating Non-ASCII Filenames.
Important: For ESQLMF to take effect, CC8BITLEVEL must not be set to 3.
If you want to compile existing source code whose non-ASCII characters have already been converted, either set ESQLMF to 0 or do not set it. In either case, esql does not invoke esqlmf.
Use the GLS8BITFSYS environment variable to tell Informix products (such as the ESQL/C processor) whether the operating system is 8-bit clean. This environment variable determines whether an Informix product can use non-ASCII characters in the filename of an operating-system file that it generates.
If you include non-ASCII characters in a filename that you specify from within a client application, you must ensure that the code set of the server-processing locale supports these non-ASCII characters. If you do not set GLS8BITFSYS, Informix database servers behave as if GLS8BITFSYS is set to 1.
For example, create a database that is called A1A2B1B2, where A1A2 and B1B2 are multibyte characters, with the following SQL statement:
If GLS8BITFSYS is 1 (or is not set) on the server computer, the database server assumes that the operating system is 8-bit clean, and it generates a database directory, A1A2B1B2.dbs.
If GLS8BITFSYS is set to 0 on the server computer and you include non-ASCII characters in the filename, the Informix product uses an internal algorithm to convert these non-ASCII characters to ASCII characters. The filenames that result are 7-bit clean.
Filenames with invalid byte sequences generate errors when they are used with GLS-based products.
Only some database utilities, such as dbexport, and the compilers for Informix ESQL/C products use GLS8BITFSYS on the client computer to create and use files. For example, suppose you compile an ESQL/C source file that is called A1A2B1B2.ec, where A1A2 and B1B2 are multibyte characters. If GLS8BITFSYS is set to 1 (or is not set) on the client computer, the ESQL/C processor generates an intermediate C file that is called A1A2B1B2.c. For a list of ESQL/C files that check GLS8BITFSYS, see Handling Non-ASCII Characters.
If your locale supports a code set with non-ASCII characters, restrictions apply to filenames for operating-system files that Informix products generate. Before you or an Informix product creates a file and assigns a filename, consider the following questions:
To support non-ASCII characters in filenames, your operating system must be 8-bit clean. An operating system is 8-bit clean if it reads the eighth bit as part of the code value. In other words, the operating system must not ignore or make its own interpretation of the value of the eighth bit.
Informix recommends that you consult your operating-system manual or system administrator to determine whether your operating system is 8-bit clean before you decide to use a nondefault locale that contains non-ASCII characters in filenames that Informix products use and generate.
Making Sure That Your Product Supports the Same Code SetOnce an Informix product has generated an operating-system file whose filename has non-ASCII characters, it has written that filename and the file contents in a particular code set. Whenever an Informix product or client application needs to access that file, you must ensure that the product uses a server-processing locale that supports that same code set.
The Server Code SetWhen the database server creates a file whose filename contains non-ASCII characters, the server locale must support these non-ASCII characters. Before you start a database server, 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 a message log with the UNIX path /A1A2B1B2/C1C2D1D2, where A1A2, B1B2, C1C2, and D1D2 are multibyte characters in the Japanese SJIS code set.
To enable the database server to create this message-log file on the server computer:
When the database server initializes, it assumes that the operating system is 8-bit clean and creates the /A1A2B1B2/C1C2D1D2 message log on UNIX, or the \A1A2B1B2\C1C2D1D2 file on Windows NT.
The Client Code SetWhen an ESQL/C processor creates a file whose filename has non-ASCII characters, the client locale must support these non-ASCII characters. Before you start an Informix database server, you must ensure that the code set of the client locale (the client code set) contains these characters. When you use a nondefault locale, you must set the CLIENT_LOCALE environment variable to the name of a locale whose code set contains these non-ASCII characters.
For example, suppose you want to process an ESQL/C source file with the path /A1A2B1B2/C1C2D1D2 , where A1A2, B1B2, C1C2, and D1D2 are multibyte characters in the Japanese SJIS code set. You must perform the following steps to enable the esql command to create the intermediate C source file on the client computer:
If the code sets that are associated with the filename and with the client locale do not match, a valid filename might contain illegal characters with respect to the client locale. The ESQL/C processor rejects any filename that contains illegal characters and displays the following error message:
The GL_DATE environment variable specifies end-user formats of values for DATE columns. For information about end-user formats, see End-User Formats.
Important: GL_DATE is evaluated when it is used. If it is invalid, the operations that called it fail.
An end-user format in GL_DATE can contain the following characters:
The following list describes the formatting directives that are not based on era.
White-space or other nonalphanumeric characters must appear between any two formatting directives. For example, if you use a U.S. English locale, you might want to format an internal DATE value for 03/05/1997 in the ASCII string format that the following example shows:
To do so, set the GL_DATE environment variable as follows:
If a GL_DATE format does not correspond to any of the valid formatting directives, the behavior of the Informix product when it tries to format is undefined.
Important: The setting of the DBDATE variable takes precedence over that of the GL_DATE environment variable, as well as over the default DATE formats that CLIENT_LOCALE specifies.
The Year Formatting Directives
You can use the following formatting directives in the end-user format of the GL_DATE environment variable to format the year of a date string: %y, %iy, %Y, and %iY. The %iy and %iY formatting directives provide compatibility with the Y2 and Y4 year specifiers of the DBDATE environment variable.
When an Informix product uses an end-user format to print an internal date value as a string, the %iy and %iY formatting directives perform the same task as %y and %Y, respectively. To print a year with one of these formatting directives, an Informix product performs the following actions:
When an Informix product uses an end-user format to read a date, the %iy and %iY formatting directives perform differently from %y and %Y, respectively. The following table summarizes how the year formatting directives behave when an Informix product uses them to read date strings.
In a read of a date string, the %iy and %y formatting directives both prefix the first two digits of the current year to expand any 1-digit or 2-digit year. However, you can set the DBCENTURY environment variable to change this assumption.
For information about end-user formats, see End-User Formats.
To support alternative date formats in an end-user format, GL_DATE accepts the following conversion modifiers:
The following table shows date-formatting directives that support conversion modifiers.
The TIME category of the locale defines the following era information:
The NUMERIC category of the locale defines the alternative digits for a locale (which the %Ox formatting directives use).
You can specify the following optional format qualifiers immediately after the % symbol of the formatting directive. A date format qualifier defines a field specification for the date that the Informix product reads or prints. The following sections describe what a field specification means for the read and print operations. For information about end-user formats, see End-User Formats.
Tip: The GL_DATETIME environment variable accepts these date format qualifiers in addition to those that Optional Time Format Qualifiers lists.
Field Specification for a Reading DATE Values
When an Informix product uses an end-user format to read a date string, the field specification defines the number of characters to expect as input. This field specification has the following syntax.
The first character of the field specification indicates whether to assume that the field value is justified or padded. If the first character is neither a minus sign nor a zero, the Informix product assumes that the field value is right justified and any spaces on the left are pad characters. However, if the field value begins with a zero, it cannot include pad characters.
An Informix product ignores the field specification if the field value is not a numeric value.
Field Specification for Displaying DATE ValuesWhen an Informix product uses an end-user format to print a date string, the field specification defines the number of characters to print as output. The syntax for the field specification is as follows.
The meaning of the precision value depends on the particular formatting