The COLLATE Clause

From InterBase
Jump to: navigation, search

Go Up to Defining Columns


The collation order determines the order in which values are sorted. The COLLATE clause of CREATE TABLE allows you to specify a particular collation order for columns defined as CHAR and VARCHAR text data types. You must choose a collation order that is supported for the given character set of the column. The character set is either the default character set for the entire database, or you can specify a different set in the CHARACTER SET clause of the data type definition. The collation order set at the column level overrides a collation order set at the domain level.

In the following statement, BOOKNO keeps the default collating order for the default character set of the database. The second (TITLE) and third (EUROPUB) columns specify different character sets and collating orders.

CREATE TABLE BOOKADVANCE (BOOKNO CHAR(6),
 TITLE CHAR(50) CHARACTER SET DOS437 COLLATE PDOX_INTL,
 EUROPUB CHAR(50) CHARACTER SET ISO8859_1 COLLATE FR_FR);

For a list of the available characters sets and collation orders that InterBase recognizes, see Character Sets and Collation Orders.