FirebirdSQL logo

In SQL, text strings are sortable objects.This means that they obey ordering rules, such as alphabetical order.Comparison operations can be applied to such text strings (for example, “less than” or “greater than”), where the comparison must apply a certain sort order or collation.For example, the expression “'a' < 'b'” means that ‘'a'’ precedes ‘'b'’ in the collation.The expression “'c' > 'b'” means that ‘'c'’ follows ‘'b'’ in the collation.Text strings of more than one character are sorted using sequential character comparisons: first the first characters of the two strings are compared, then the second characters, and so on, until a difference is found between the two strings.This difference defines the sort order.

A COLLATION is the schema object that defines a collation (or sort order).

CREATE COLLATION

Defines a new collation for a character set

Available in

DSQL

Syntax
CREATE COLLATION collname
    FOR charset
    [FROM {basecoll | EXTERNAL ('extname')}]
    [NO PAD | PAD SPACE]
    [CASE [IN]SENSITIVE]
    [ACCENT [IN]SENSITIVE]
    ['<specific-attributes>']

<specific-attributes> ::= <attribute> [; <attribute> ...]

<attribute> ::= attrname=attrvalue
Table 1. CREATE COLLATION Statement Parameters
Parameter Description

collname

The name to use for the new collation.The maximum length is 63 characters

charset

A character set present in the database

basecoll

A collation already present in the database

extname

The collation name used in the .conf file

The CREATE COLLATION statement does not “create” anything, its purpose is to make a collation known to a database.The collation must already be present on the system, typically in a library file, and must be properly registered in a .conf file in the intl subdirectory of the Firebird installation.

The collation may alternatively be based on one that is already present in the database.