For an introduction to the issues you may face when working in an environment that uses more than one character set, or when using languages other than English, see “SQL Anywhere international features” in SQL Anywhere Server – Database Administration > Configuring Your Database > International languages and character sets > Localized versions of SQL Anywhere.
When you create a database, you specify a collating sequence or collation to be used by the database. A collation is a combination of a character set and a sort order for characters in the database.
The database collation is used to sort and compare all character data types in the database, including object names, such as table and column names.
Sybase IQ support of database collations takes advantage of the space efficiency and speed of the SQL Anywhere Collation Algorithm.
The database option SORT_COLLATION allows implicit use of the SORTKEY function on ORDER BY expressions. When the value of this option is set to a valid collation name or collation ID, any string expression in the ORDER BY clause is treated as if the SORTKEY function has been invoked.
See “SORT_COLLATION option” in Chapter 2, “Database Options” of Reference: Statements and Options.
The SORTKEY function uses the International Components for Unicode (ICU) library, instead of the Sybase Unicode Infrastructure Library (Unilib®). Sort key values created using a version of Sybase IQ earlier than 15.0 do not contain the same values created using version 15.0 and later. Regenerate any sort key values in your database that were generated using a version of Sybase IQ earlier than 15.0.
For more information and syntax, see “SORTKEY function [String]” in Chapter 4, “SQL Functions”of Reference: Building Blocks, Tables, and Procedures.
The CREATE DATABASE parameter COLLATION supports specification of a collation for a database.
See CREATE DATABASE statement in Chapter 1, “SQL Statements” of Reference: Statements and Options.
The collation of the database must match the collation used by the operating system. In the Sybase Central Create Database wizard, the default character set is ISO_BINENG; change this, if necessary, to match the character set used by the operating system.
The CP874toUTF8 utility converts data in the CP874 character set into UTF8 collation, a collation supported by Sybase IQ for the Thai language. The CP874toUTF8 utility calls the ICU library to perform data conversion. You can also load data in the CP874 character set without converting the data to UTF8 using this utility.
See “CP874toUTF8 utility” in Chapter 4, “Database Administration Utilities” of the Utility Guide.
Sybase IQ no longer supports custom collations. If you are rebuilding a database with a custom collation, the collation is preserved if you rebuild in a single step. If you unload the database and then load the schema and data into a database that you create, then you must use one of the supplied collations.
For more information on changes to database collations and a list of collations deprecated in Sybase IQ 15.0, see Chapter 2, “Behavior Changes in Sybase IQ 15.0” in New Features in Sybase IQ 15.0. Use the iqunload utility to migrate to Sybase IQ 15.2 from an existing 12.6 or 12.7 database that was created with a deprecated collation. For details about iqunload, see the Installation and Configuration Guide.