Home | Previous Page | Next Page   Appendix A. Managing GLS Files > GLS Locale Files >

Locale Categories

A locale file specifies behaviors for the locale categories. The CTYPE and COLLATION categories primarily affect how the database server stores and retrieves character data in a database. The NUMERIC, MONETARY, and TIME categories affect how a client application formats the internal values of the associated SQL data types. For more information about end-user formats, see End-User Formats and Customizing End-User Formats. The following table describes the locale categories and the behaviors for the default locale, U.S. English.

Locale Category Description In Default Locale (U.S. English)
CTYPE Controls the behavior of character classification and case conversion. The default code set classifies characters. On UNIX, the default code set is ISO8859-1. On Windows, the default code set is Windows Code Page 1252.
COLLATION Controls the behavior of string comparisons. The default locale does not define a localized order. Therefore, the database server collates NCHAR and NVARCHAR data in code-set order (unless SET COLLATION has specified some localized order).
NUMERIC Controls the behavior of non-monetary numeric end-user formats. The following numeric notation for use in numeric end-user formats:
  • Thousands separator: comma (,)
  • Decimal separator: period (.)
  • Number of digits between thousands separators: 3
  • Symbol for positive number: plus (+)
  • Symbol for negative number: minus (-)
  • No alternative digits for era-based dates
MONETARY Controls the behavior of currency end-user formats. The following currency notation for use in monetary end-user formats:
  • Currency symbol: dollar sign ($) appears as the front symbol before the currency value
  • No back currency symbol is defined.
  • Thousands separator: comma (,)
  • Decimal separator: period (.)
  • Number of digits between thousands separators: 3
  • Symbol for positive number: plus (+)
  • Symbol for negative number: minus (-)
Default scale for MONEY columns: 2
TIME Controls the behavior of date and time end-user formats. The following date and time end-user formats:
  • DATE values: %m/%d/%iy
  • DATETIME values: %iY-%m-%d %H:%M:%S
No definitions for era-based dates.
MESSAGES Controls the definitions of affirmative and negative responses to messages. None

The CTYPE Category

The CTYPE category defines how to classify the characters of the code set that the locale supports. This category includes specifications for which characters the locale classifies as spaces, blanks, control characters, digits, uppercase letters, lowercase letters, and punctuation symbols.

This category might also include mappings between uppercase and lowercase letters. IBM Informix products access this category when they need to determine the validity of an identifier name, to shift the letter case of a character, or to compare characters.

The COLLATION Category

The COLLATION category can define a localized order. When an IBM Informix product needs to compare two strings, it first breaks up the strings into a series of collation elements. The database server compares each pair of collation elements according to the collation weights of each element. The COLLATION category supports the following capabilities:

The difference in collation order is the only distinction between the CHAR and NCHAR data types and the VARCHAR and NVARCHAR data types. For more information, see Using Character Data Types.

If a locale does not contain a COLLATION category, IBM Informix products use code-set order for collation of all character data types:

Dynamic Server

The SET COLLATION statement can specify a localized collation that is different from the COLLATION setting of the locale that DB_LOCALE specifies. The scope of the collating order that SET COLLATION specifies is the current session, but database objects that can sort strings, such as constraints, indexes, UDRs, and triggers, always use the collating order from the time of their creation when they sort NCHAR or NVARCHAR values.

End of Dynamic Server

The NUMERIC Category

The NUMERIC category defines the following numeric notation for end-user formats of nonmonetary numeric values:

This numeric notation applies to the end-user formats of data for numeric (DECIMAL, INTEGER, SMALLINT, FLOAT, SMALLFLOAT) columns within a client application.

Important:
Information in the NUMERIC category does not affect the internal format of the numeric data types in the database.

The NUMERIC category also defines alternative digits for use in era-based dates and times. For information about alternative digits, see Alternative Date Formats and Alternative Time Formats.

The MONETARY Category

The MONETARY category defines the following currency notation for end-user formats of monetary values:

This currency notation applies to the end-user formats of data from MONEY columns within a client application.

Important:
Information in the MONETARY category does not affect the internal format of the MONEY data type in the database.

The MONETARY category also defines the default scale for a MONEY column. For the default locale (U.S. English), the database server stores values of the data type MONEY(precision) in the same internal format as the data type DECIMAL(precision,2). A nondefault locale can define a different default scale. For more information on default scales, see Specifying Values for the Scale Parameter.

The TIME Category

The TIME category lists characters and symbols that format date and time values. This information includes the names and abbreviations for days of the week and months of the year. It also includes special representations for dates, time (12-hour and 24-hour), and DATETIME values.

These representations can include the names of eras (as in the Japanese Imperial era system) and non-Gregorian calendars (such as the Arabic lunar calendar). The locale specifies the calendar (Gregorian, Hebrew, Arabic, Japanese Imperial, and so on) for reading or printing a month, day, or year.

If the locale supports era-based dates and times, the TIME category defines the full and abbreviated era names and special date and time representations. For more information, see Alternative Date Formats and Alternative Time Formats.

This date and time information applies to the end-user formats of data in DATE and DATETIME columns within a client application.

Important:
Information in the TIME category does not affect the internal format of the DATE and DATETIME data types in the database.

The MESSAGES Category

The MESSAGES category defines the format for affirmative and negative responses. This category is optional. IBM Informix products do not use the strings that the MESSAGES category defines.

To obtain the locale name for the MESSAGES category of the client locale, a client application uses the locale that CLIENT_LOCALE indicates. If CLIENT_LOCALE is not set, the client sets the category to the default locale.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]