Have you tested their example Rob?
I think they have the output wrong for SUBSTR, at least for languages that
do indeed support umlauts. Perhaps when converting the output to English
something bizarre happened to person who documented this example.
To enter umlaut type characters your job would need to be in an appropriate
CCSID (i.e. DEU, DE, 273 for Germany as German supports umlauts).
If you then turn around and display them via that sample query, I'd fully
expect to get the same results from LEFT and SUBSTR.
So, I'd chalk it off to documenting mistake.
Elvis
Celebrating 11-Years of SQL Performance Excellence on IBM i5/OS and OS/400
www.centerfieldtechnology.com
-----Original Message-----
Subject: LEFT vs SUBSTR
Not that I am big into UCS but someone want to explain this for me:
Assume that NAME is a VARCHAR(128) column, encoded in Unicode UTF-8, that
contains the value 'Jürgen'.
SELECT LEFT(NAME, 2), SUBSTR(NAME, 1, 2)
FROM T1
WHERE NAME = 'Jürgen'
Returns the value 'Jü' for LEFT and 'JÊ' for SUBSTR(NAME, 1, 2).
http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/db2/rbafzs
caleft.htm
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.