SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
C-43
Collations
Collations
A collation is an SQL object that contains rules for collating sequence (the sequence in
which characters are ordered for sorting), case (whether characters are uppercase or
lowercase), and character class and character string equivalence (whether character
variants should be handled as equivalents or whether character variants should be
handled as one letter).
NonStop SQL/MP supports collations for single-byte character sets, but not for double-
byte character sets. (Double-byte character values always collate in binary order and
cannot be upshifted.)
When you create or index a column that has a character data type and a single-byte
character set, you can specify the name of a collation to associate with the column.
The collation defines the default sort order for values in the column within the table or
index. When you create a column that is part of the primary key for the table and
associate a collation with that column, the collation also affects the storage order for
rows in the table.
You can also specify a collation as part of a character expression that uses single-byte
character strings (for example, an expression that compares two character strings from
the ISO88591 character set), modifying the ordering and equivalence relationships that
determine the result of the expression. (For more information, see Character
Expressions on page C-14.)
A collation name must be a Guardian name.
You create a collation with the CREATE COLLATION statement.
You associate an existing collation with a column or index when you specify the data
type for the column or index at the time you create it with the CREATE TABLE, ALTER
TABLE, or CREATE INDEX statement. For information on the clause that specifies the
data type on these statements, see Data Types
on page D-1.
NonStop SQL/MP includes a set of Guardian procedures that you can invoke from host
language programs to compare collations or return information about a collation. For
more information about these procedures, see the SQL/MP Programming Manual for
COBOL or the SQL/MP Programming Manual for C.