FirebirdSQL logo
 EXCEPTIONCHARACTER SET 

Who Can Create a Collation

The CREATE COLLATION statement can be executed by:

The user executing the CREATE COLLATION statement becomes the owner of the collation.

Examples using CREATE COLLATION

  1. Creating a collation using the name found in the fbintl.conf file (case-sensitive)

    CREATE COLLATION ISO8859_1_UNICODE FOR ISO8859_1;
  2. Creating a collation using a special (user-defined) name (the “external” name must match the name in the fbintl.conf file)

    CREATE COLLATION LAT_UNI
      FOR ISO8859_1
      FROM EXTERNAL ('ISO8859_1_UNICODE');
  3. Creating a case-insensitive collation based on one already existing in the database

    CREATE COLLATION ES_ES_NOPAD_CI
      FOR ISO8859_1
      FROM ES_ES
      NO PAD
      CASE INSENSITIVE;
  4. Creating a case-insensitive collation based on one already existing in the database with specific attributes

    CREATE COLLATION ES_ES_CI_COMPR
      FOR ISO8859_1
      FROM ES_ES
      CASE INSENSITIVE
      'DISABLE-COMPRESSIONS=0';
  5. Creating a case-insensitive collation by the value of numbers (the so-called natural collation)

    CREATE COLLATION nums_coll FOR UTF8
      FROM UNICODE
      CASE INSENSITIVE 'NUMERIC-SORT=1';
    
    CREATE DOMAIN dm_nums AS varchar(20)
      CHARACTER SET UTF8 COLLATE nums_coll; -- original (manufacturer) numbers
    
    CREATE TABLE wares(id int primary key, articul dm_nums ...);