Informix Online Documentation |
Date: 05/22/00
Version: 3.08
This document describes feature and performance topics not covered in the Informix Guide to GLS Functionality or modified since publication.
This manual might not reflect the latest names of Informix database servers. The following table lists the database server versions and their corresponding names.
Informix Internet Foundation 2000 provides support for the following Informix GLS environment varaibles: CLIENT_LOCALE, DB_LOCALE, GL_DATE, and DBCENTURY. Informix Internet Foundation 2000 also provides support for the following Informix GLS properties: GL_DATETIME and DB_TIME. For information about Informix Internet Foundation 2000 and using these environment variables with Java, see the documentation notes for Creating UDRs in Java.
The glossary that was formerly in the Informix Guide to GLS Functionality is now in the Informix Guide to SQL: Reference.
To create messages for exceptions raised within UDRs (with mi_db_error_raise()), insert them in the syserrors system catalog table. For more information, see "Internationalized Exception Messages" on page 4-17 of the 9.2 Informix Guide to GLS Functionality. However, to insert these messages, the locale of the message text must match the server-processing locale. If these locales are different, use of an SQL script or a UDR (with mi_exec()) to insert the messages is not reliable. The SQL parser triggers an error condition when it encounters characters that it does not recognize.
To bypass this restriction, you can use a UDR that prepares the INSERT statement (with mi_prepare()) to load the error messages. In the prepared INSERT statement:
These values are in the first and last columns (sqlstate and message), respectively, of the syserrors system catalog table.
The locale name is in the second column (locale) of syserrors.
For example, the following line prepares an INSERT statement for messages in the default locale of U.S. English (en_us) on a UNIX system:
To execute this prepared INSERT statement, provide values for the placeholders (sqlstate and message) and then use the mi_exec_prepared_statement() function to send the INSERT to the database server. (For more information on sending SQL statements with mi_exec_prepared_statement(), see "Executing Prepared SQL Statements" on page 8-16 of the 9.2 Informix DataBlade API Programmer's Manual.
The following UDR code uses a message array (enus_msg) to hold the SQLSTATE values and their associated message text. It puts information about each element of this message array in the approrpriate placeholder arrays (args, lens, nulls, and types) of the mi_exec_prepared_statement() function.
To store data from more than one non-English language in one database, you can either use the GLS implementation of the UTF-8 UCS GLS locale and code set conversion files, or use the Unicode UCS in your database. To use Unicode with Informix GLS, you must be using Informix Dynamic Server with Universal Data Option (IDS/UD) Version 9.1x or above, and the Informix Unicode DataBlade module. The Unicode DataBlade module enables users to store data in native Unicode format in a database and to access and manipulate that data. For more information, see the Informix Unicode DataBlade Module User's Guide.