Selecting the default sort order

Sybase servers can support only one default sort order at a time. If your users are using the same language or their languages use the same sort order, then select the desired sort order. For example, if your users are using French data and expect French sorting, then you can pick one of the French dictionary sort orders. Or if your users are using data in multiple languages and the languages use the same sort order, for example English, French, and German, you can pick one sort order and it will work for all your users in all languages.

However, if you have users using different languages that require different sort orders, for example French and Spanish, then you must select one of the sort orders as the default. If you pick, for example, a French sort order, your Spanish users will not see the ch and ll double characters sorted as they would expect. The installation procedure, by default, configures the server with the binary sort order.

You can use the sortkey function to setup customized alternative sort orders for your data—one for each language.These sort orders can be selected dynamically to meet the needs of different users. The sortkey function is separate from the default sort order, but can coexist in the same server. The range and depth of sort orders provided by the sortkey function is better than those provided by the default sort order mechanism. For more information, see sortkey and compare in the Reference Manual.

Table 7-5: Available sort orders

Language or script

Character sets

Sort orders

All languages

UTF-8

Binary

Cyrillic:

Bulgarian, Byelorussian, Macedonian, Russian, Serbian, Ukrainian

CP 855, CP 866, CP 1251, ISO 8859-5, Koi8, Macintosh Cyrillic

Dictionary order, case sensitive, accent sensitive

English, French, German

ASCII 8, CP 437, CP850, CP 860, CP 863, CP 1252a, ISO 8859-1, ISO 8859-15, Macintosh Roman, ROMAN8

Dictionary order, case sensitive, accent sensitive

Dictionary order, case insensitive, accent sensitive

Dictionary order, case sensitive, accent sensitive, with preference

Dictionary order, case insensitive, accent insensitive

English, French, German

CP 850

Alternate dictionary order, case sensitive

Alternate dictionary order, case sensitive, accent insensitive

Alternate dictionary order, case sensitive, with preference

Greek

ISO 8859-7

Dictionary order, case sensitive, accent sensitive

Hungarian

ISO 8859-2

Dictionary order, case sensitive, accent sensitive

Dictionary order, case insensitive, accent sensitive

Dictionary order, case insensitive, accent insensitive

Russian

CP 866, CP 1251, ISO 8859-5, Koi8, Macintosh Cyrillic

Dictionary order, case sensitive, accent sensitive

Dictionary order, case insensitive, accent sensitive

Scandinavian

CP 850

Dictionary order, case sensitive, accent sensitive

Dictionary order, case insensitive, with preference

Spanish

ASCII 8, CP 437, CP850, CP 860, CP 863, CP 1252, ISO 8859-1, ISO 8859-15, Macintosh Roman, ROMAN8

Dictionary order, case sensitive, accent sensitive

Dictionary order, case insensitive, accent sensitive

Dictionary order, case insensitive, accent insensitive

Thai

CP 874, TIS 620

Dictionary order

Turkish

ISO 8859-9

Dictionary order, case sensitive, accent sensitive

Dictionary order, case insensitive, accent insensitive

Dictionary order, case insensitive, accent sensitive

If your language does not appear here, there is no language-specific sort order for your language. Select a binary sort order and then investigate whether the sortkey function meets your needs. As this table illustrates, many languages have more than one sort order.