Code-set order

Code-set order is the order of characters within a code set. The order of the code points in the code set determines the collating order.

For example, in the ASCII code set, A=65 and B=66. The character A always sorts before B because a code point of 65 is less than one of 66. But because a=97 and M=77, the string abc sorts after Me, which is not always the preferred result.

The database server uses code-set order to sort columns of these data types:
  • CHAR
  • LVARCHAR
  • VARCHAR
  • TEXT

All code sets that HCL OneDB™ products support include the ASCII characters as the first 127 characters. Therefore, other characters in the code set have the code points 128 and greater. When the database server sorts values of these data types, it puts character strings that begin with ASCII characters before characters strings that begin with non-ASCII characters in the sorted results.

For an example of data sorted in code-set order, see ids_gug_137.html#ids_gug_137__sii-03-36085.