SQL/MP Installation and Management Guide
Creating a Database
HP NonStop SQL/MP Installation and Management Guide—523353-004
5-56
Creating Collation Source Files
•
An SQL expression in a SELECT statement to specify different collating sequences
(including upshifting) for character strings
•
The WHERE clause in an UPDATE or DELETE statement to specify a different
collating sequence for a column
•
The CREATE INDEX statement to specify an order that differs from the base table
•
The CREATE CONSTRAINT statement to specify a collating sequence for a
column in the constraint
For the syntax of these statements, see the SQL/MP Reference Manual.
Creating Collation Source Files
To create a collation source file, you enter rules for character processing into an EDIT
file in collation compiler syntax. The SQL/MP Reference Manual describes the syntax
for specifying these rules in a collation source file. You must create a collation source
file for each collation specified in your database design.
You then create the collation by executing the CREATE COLLATION statement either
from SQLCI or embedded in a C program. The CREATE COLLATION statement calls
the collation compiler to compile the collation source file and generate the collation.
This statement also registers the collation in the SQL catalog.
After you create a collation, you can use the ALTER COLLATION statement to rename
it or change its security string or owner if necessary. To delete a collation, you can use
the DROP COLLATION statement, as long as the collation is not used by any SQL
objects or programs. HP also provides a set of system procedures you can use to
manipulate collations (for example, to read a collation or to compare two collations).
Example 5-4 shows a sample source file.
Example 5-4. Collation Source File (page 1 of 3)
LC_COLLATE
# This file contains character processing rules.
#
# The collating sequence sorts most of the accented forms of a, e, i,
# o, and u equal to the unaccented form. The collating sequence is
# case insensitive.
#
# Upshift for a, e, i, o, u -grave -acute -circumflex is
# A, E, I, O, U. Upshift for e-umlaut is E. Upshift for i-umlaut
# is I, and upshift for y-acute is Y.
#
# These character processing rules are for the ISO88591 character set.
# Start the collating orders.
order_start forward
\d032 \d032 # 32 = space #
\d160 \d032 # NBSP #
<0> <0>
... ...