|
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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.