2

I'm struggling with DB2 - sorting by Polish letters with diacritics and uppercase/lowercase. When I created a database using:

CREATE DATABASE P1DS8 AUTOMATIC STORAGE YES ON '/home/db2inst1' DBPATH ON '/home/db2inst1' USING CODESET UTF-8 TERRITORY PL COLLATE USING SYSTEM_912_PL PAGESIZE 32 K 

Sorting by Polish letters works properly, however ascending sorting returns results ordered by lowercase as first aAbB... How I can change this setting to revert results to AaBb..?

Is the 'COLLATE' section is responsible for all aspects of sorting? (Specific language letters, lowercase, uppercase etc. )

1

You'd need to use the UCA (Unicode Collating Algorithm): the COLLATE value would be something like UCA500R1_LPO_CU for Polish and uppercase first. More info here.

Note that you cannot change the collating setting of an existing database; you would have to create a new one with the required collation and move your data.

0

The collate is responsible for the sorting order. See http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.nls.doc/doc/c0006812.html for some explanation.

Unfortunately, I can't tell you what other sort order you need to choose for polish letters. IBM might know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.