SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
C-30
Collation Definitions
Collation Definitions
A collation definition is a description of a collating sequence that can be written in an
EDIT file and processed by the CREATE COLLATION statement to create an SQL
collation.
The simplest possible collation definition consists of an LC_COLLATE section that
includes an ordered list of elements in the collation.
More complex collation definitions can also include comments, redefine the comment
and escape characters, define multicharacter collation elements in the LC_COLLATE
section, define character classes and upshifting rules in the LC_CTYPE section, and
specify a character set for the collation in the LC_TDMCODESET section.
The language in which you express a collation definition is based on the POSIX/XPG4
standard, so you can take a localedef source file from an X/Open Locale Registry and
create an SQL/MP collation definition with only minimal modifications. The language
follows completely different syntactic and semantic rules from SQL statements or
SQLCI commands. One major difference is that case is significant in keywords within
collation definitions.
The remainder of this entry describes the collation definition language, beginning with
rules for comment and escape characters, followed by rules for each of the three major
sections within a collation description (the LC_COLLATE section, the LC_CTYPE
section, and the LC_TDMCODESET section), and ending with examples and special
considerations.
Remember that keywords shown in uppercase must be entered in uppercase, and
keywords shown in lowercase must be entered in lowercase. Also note that angle
brackets appear in several parts of the collation definition language as an element of
the language itself to represent variable items you must supply, as they are commonly
used elsewhere in this documentation.
Comment and Escape Characters in Collation Definitions
The default comment character is the number sign (#).
The default escape character is the backslash (\).
Use the comment character to include comments in a collation definition. All characters
between the comment character and the end of a physical line are handled as a
comment, including the escape character.
You use the escape character to continue a clause over more than one physical line. If
you specify the escape character as the last character in a physical line, this line is
handled as a continuation of the line that ended with the escape character. You also
use the escape character to indicate the beginning of an octal, decimal, or
hexadecimal code that represents a character within the collation, as explained under
The LC_COLLATE Section of a Collation Definition on page C-32.