Recommended Resources
Abstract
When creating the following db as such:
db2 create database sample using codeset 1252 territory AU
db2 connect to sample
db2 "select * from sysibm.sysdummy1 where 'A' between 'a' and 'b"
IBMREQD
-------
Y
1 record(s) selected.
db2 "select * from sysibm.sysdummy1 where 'A' = 'a' "
IBMREQD
-------
0 record(s) selected.
db2 "select hex('A') as HEX_A, hex('a') as "HEX_a", hex('b') as "HEX_b" from sysibm.sysdummy1 where 'A' between 'a' and 'b'"
HEX_A HEX_a HEX_b
----- ----- -----
41 61 62
Content
The above will set the db cfg to: "Database collating sequence=UNIQUE".
From above, the weight of 'A' *is* in between 'a' and 'b'. See the the collation table for codepage 1252:
The sorting is determined by collating sequence, not by hex representation of a code point (character). The collating sequence UNIQUE uses weights as defined in the collation table for given codepage/territory as above link.
Once the database has been created, the collating sequence cannot be changed.
There is no other way to change the collation sequence of a database other than rebuilding it. The reason is there are so many database objects affected by the collation (indexes, MQT tables, constraints, generated columns, MDC, routines, packages, optimization profile, ...), any change in collation would require rebuilding these database objects.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21593904