Previous Topic

Next Topic

Local Collation Sequences

A collation sequence determines the sorting order of any given character set. For example, in English, the order of the alphabet is most commonly used to order a list of English words. That is, words beginning with the letter c appear before words beginning with the letter d, which appear before words beginning with the letter e and so on.

A collation sequence is associated with each database when the database is created. This sequence determines in what order sorted data is returned to users and applications, what is returned when queries use pattern matching and, in some instances, how data is stored internally.

Previous Topic

Next Topic

Supported Collation Sequences

In a computer, if no other collation sequence is enforced, the sequence derived from the machine's native character set, either ASCII or EBCDIC is used. The sorting order of these character sets derives from the internal numeric representation of each character.

In addition to the sequences derived from ASCII and EBCDIC, Ingres supports two other local collation sequences. They are:

If none of these sequences adequately fills your needs, you can write your own local collation sequence.

Previous Topic

Next Topic

MultiCollation Sequence

The multi collation sequence is based on the DEC Multinational Character Set. This character set adds several vowels with diacritical marks to the standard 7-bit ASCII character set.

Following are the comparison sequences for the multi sequence that differ from those of ASCII:

A < À < Á < Â < Ã < Ä < B

C < Ç < D < E < È < É < Ê < Ë

I < Ì < Í < Î < Ï < J

N < Ñ < O

O < Ò < Ó < Ô < Õ < Ö < Œ < P

U < Ù < Ú < Û < Ü < V

Y < Ÿ < Z < Æ< Ø < Å

a < à < á < â < ã < ä < b

c < ç < d < e < è < é < ê < ë

i < ì < í < î < ï < j

n < ñ < o

o < ò < ó < ô < õ < ö < œ < p

ss < ß < st

u < ù < ú < û < ü < v

y < ÿ < z < æ < ø < å

For example:

cote < côte < czar < cæsar

Pattern matching rules:

Previous Topic

Next Topic

Spanish Collation Sequence

The Spanish collation sequence is based on the multi sequence but contains additional support for the Spanish letters ll and ch. Listed below are the comparison sequences for the Spanish collation sequence that differ from those of ASCII. Some pattern matching rules are also described.

A < À < Á <Â < Ã < Ä < B

CZ < CÅ < Ç < CH < Ch < D < E < È < É < Ê < Ë

I < Ì < Í < Î < Ï < J

LZ < LÅ < LL < LI < M

N < Ñ < O

O < Ò < Ó< Ô < Õ < Ö < Œ < P

U < Ù < Ú < Û < Ü <V

Y < Ÿ < Z <Æ< Ø < Å

a < à < á < â < ã < ä < b

cz < câ < ç < cH < ch < d < e < è < é < ê < ë

i < ì < í < î < ï < j

lz < lå < lL < ll < m

n < ñ < o

o < ò < ó < ô < õ < ö < œ < p

ss < ß < st

u < ù < ú < û < ü < v

y < ÿ < z < æ < ø < å

Examples:

loop < llama

cote < côte < czar < cæsar < chair

The pattern matching rules are:

Previous Topic

Next Topic

Custom Collation Sequence

If you have special needs that are not met by the available collation sequences, you can write your own. Ingres allows you to write a collation sequence that has any of the following characteristics:

Previous Topic

Next Topic

Guidelines for Creating a Custom Collation File

Keep the following points in mind as you design and test your custom collation file:

Previous Topic

Next Topic

How You Write a Customize Collation Sequence

To create a customized collation sequence, follow these steps:

  1. Write a description file.
  2. Run the description file through the aducompile utility.
  3. Test your collation sequence with a small sample database.

Previous Topic

Next Topic

Description File—Describe Collation Sequence

To define a custom collation sequence you must create a description file, which consists of a list of "instructions" that, taken as a whole, describe the collation sequence. Each instruction must appear on a separate line in the file.

The format of each instruction is:

value:string

where:

Previous Topic

Next Topic

The aducompile Utility

The aducompile utility compiles your description file into a binary file and installs that file as a collation sequence that can be used. You must be the installation owner to use this utility. Be sure to give your resulting collation file a unique name so that you do not overwrite any existing collation files.

Your new collation sequence is located at $II_SYSTEM/ingres/files/collation/collation_name.

Note: In UNIX, all system users must have rights to read the new collation file.


© 2007 Ingres Corporation. All rights reserved.