NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-27
Examples—CLUSTERING KEYS
Examples—CLUSTERING KEYS
The following statement declares a table with a clustering key:
CREATE TABLE CK (SYS_ID SMALLINT, CPU SMALLINT, PIN SMALLINT,
PROG_NAME VARCHAR(34)) CLUSTERING KEY (SYS_ID, CPU, PIN);
COLLATE Clause
The COLLATE clause associates an existing collation with a character expression, with
a column of a character data type that is being added to a table, or with an index that is
being created.
See Character Expressions
on page C-11 for information about using the COLLATE
clause on a character expression.
See Data Types
on page D-1 for information about using the COLLATE clause with a
data type specification for a CREATE TABLE or ALTER TABLE statement.
See CREATE INDEX Statement
on page C-133 for information about using the
COLLATE clause to associate a collation with an index.
See Collation Definitions
on page C-27 for general information about collations.
See CREATE COLLATION Statement
on page C-130 and Collation Definitions on
page C-27 for information about creating collations.
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 a NonStop 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