Hello,
My
http://troels.arvin.dk/db/rdbms/ page is getting outdated, so I
thought it was time to play a bit with DB2 10.5, especially after reading
that DB2 10.5 might finally have fixed Unicode string handling, so that
the length of a string like "Fej�" is four (and not five).
But it seems the length function still doesn't get it. The
CHARACTER_LENGTH function gets it, but it requires a special CODEUNITS16
or CODEUNITS32 argument; this is absurd, as a developer shouldn't have to
care about such byte handling stuff. And so many other DBMSes have no
problem handling something as basic as the length of strings; one would
think DB2 can handle such fundamentals.
I then saw the "string_units" DB configuration parameter and thought that
it should be able to help me, but:
$ db2 update db cfg using STRING_UNITS CODEUNITS32
SQL5130N The value specified for the configuration parameter
"string_units" is not in the valid range of "0" to "0".
I strongly believe that the database I had created was a Unicode one;
selected DB cfg parameters in the database:
Database territory = US
Database code page = 1208
Database code set = UTF-8
Database country/region code = 1
Database collating sequence = UCA500R1_LDA_AN_CU_EX_FX_HX_NX_S3
Alternate collating sequence (ALT_COLLATE) =
Varchar2 compatibility = OFF
CHAR output with DECIMAL input (DEC_TO_CHAR_FMT) = NEW
National character string mapping (NCHAR_MAPPING) = GRAPHIC_CU16
Have I done something wrong? Why can't I set STRING_UNITS to CODEUNITS32,
as described at
http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/
com.ibm.db2.luw.admin.config.doc/doc/r0060936.html
--
Troels