Hi,
Please refer to the below problem:
Problem
We need to deal with multi-byte character sets like Japanese, Chinese etc. Our application uses built-in string scalar functions like SUBSTR , LENGTH etc. However these functions are dependent on bytes rather than characters.
For example SELECT SUBSTR (‘你好’, 1, 3) FROM SYSIBM.SYSDUMMY1 returns 你 (only one character since each Chinese character in this implementation is being represented by three bytes) while SELECT SUBSTR(‘Hello’, 1, 3) FROM SYSIBM.SYSDUMMY1 returns ‘Hel’ (each English character being represented by a single byte.).
Oracle 9i has introduced some Unicode compliant functions like INSTRC, INSTR2, INSTR4, SUBSTRC, SUBSTR2, and SUBSTR4 which are capable of understanding the fact that a particular sequence of bytes actually represents a single character in reality. For example, the standard LENGTH function will interpret code point 0x0061 followed by code point 0x0303 as two separate characters. The LENGTHC function, because it is designed for use with Unicode, will recognize that in Unicode, 0x0061 followed by 0x0303 really represents just one character.
Do we have similar functions in DB2 UDB for LUW? I have searched a lot on the net but could not find such functions in DB2 UDB. Just wanted to ask you whether such functions exist in DB2 UDB. Else how do we deal with such a scenario in DB2 UDB.