thanks in advance
mailar
Do you mean between GRAPHIC and CHAR or between different encodings
within CHAR (and VARCHAR)?
Also Which platform are you on? In DB2 for LUW conversion is only done
implicitly between the client and the server. Only conversion to and
from BIT data can be done explicitly using the CAST() specification.
To cast from CHAR to GRAPHIC (and back) in a Unicode database usual cast
fucntions should work. GRAPHIC and CHAR are considered equivalent in
V8, btw)
In DB2 for zOS the CAST() specification can be used to cast to and from
Unicode as well using: CAST(c_db AS VARCHAR(10) CCSID UNICODE) or
CAST(c_uni AS VARCHAR(10) CCSID ASCII)
(DB2 zOS also supports a notation with SBCS and MBCS which I'm not very
familiar with. I believe it is legacy though)
I'm not familiar enough with DB2 for iSeries, but I think you can also
use CAST() and specify the CCSID by it's integer number. DB2 for iSeries
is leading the charge in this area.
Cheers
Serge
Syntax
to_single_byte::=TO_SINGLE_BYTE(attribute)
Purpose
TO_SINGLE_BYTE returns attribute with all of its multibyte characters
converted
to their corresponding single-byte characters; attribute can be of data
type CHAR
or VARCHAR2. The value returned is in the same data type as attribute.
Any
multibyte characters in attribute that have no single-byte equivalents
appear in the
output as multibyte characters.
This function is useful only if your database character set contains
both single-byte
and multibyte characters.
Example
The following example illustrates going from a multibyte 'A' in UTF8 to
a single byte
ASCII 'A':
SELECT TO_SINGLE_BYTE( CHR(15711393)) FROM DUAL;
T
-
A
So, Could you tell me is ther a function or some feature in DB2 which
enables me to do this conversion.
Also, could you help me in going about the implementation of this
function in DB2.
Thanks and regards
mailar
Cheers
Serge