Prev: Result set from ADMIN_CMD
Next: SQL error 805
From: Gregor Kova? on 27 Oct 2006 03:44 Hi! Does DB2 handle extended ASCII table? Example: VALUES(CHR(65)) => A VALUES(CHR(129)) => null, but according to www.asciitable.com should be u with umlaut. Any idea ? Best regards, Kovi -- -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
From: Serge Rielau on 27 Oct 2006 11:19 Gregor Kovac( wrote: > Hi! > > Does DB2 handle extended ASCII table? > Example: > VALUES(CHR(65)) => A > VALUES(CHR(129)) => null, but according to www.asciitable.com should be u > with umlaut. > > Any idea ? I quote from the URL: The _most_popular_ is presented below. For single byte code pages I don't see a reason not to support all 255 characters and do whatever the DB code page mandates. Anyway, the easiest workaround is probably to imply write a trivial UDF in C/Java/CLR which does the job. Cheers Serge -- Serge Rielau DB2 Solutions Development IBM Toronto Lab IOD Conference http://www.ibm.com/software/data/ondemandbusiness/conf2006/
From: Serge Rielau on 27 Oct 2006 11:19 Serge Rielau wrote: > Gregor Kovac( wrote: >> Hi! >> >> Does DB2 handle extended ASCII table? >> Example: >> VALUES(CHR(65)) => A >> VALUES(CHR(129)) => null, but according to www.asciitable.com should be u >> with umlaut. >> >> Any idea ? > I quote from the URL: > The _most_popular_ is presented below. > For single byte code pages I don't see a reason not to support all 255 > characters and do whatever the DB code page mandates. > > Anyway, the easiest workaround is probably to imply write a trivial UDF > in C/Java/CLR which does the job. Of course a big case expression will also work ;-) Cheers Serge -- Serge Rielau DB2 Solutions Development IBM Toronto Lab IOD Conference http://www.ibm.com/software/data/ondemandbusiness/conf2006/
From: Gregor Kova? on 27 Oct 2006 12:11 Serge Rielau wrote: > Serge Rielau wrote: >> Gregor Kovac( wrote: >>> Hi! >>> >>> Does DB2 handle extended ASCII table? >>> Example: >>> VALUES(CHR(65)) => A >>> VALUES(CHR(129)) => null, but according to www.asciitable.com should be >>> u with umlaut. >>> >>> Any idea ? >> I quote from the URL: >> The _most_popular_ is presented below. >> For single byte code pages I don't see a reason not to support all 255 >> characters and do whatever the DB code page mandates. >> >> Anyway, the easiest workaround is probably to imply write a trivial UDF >> in C/Java/CLR which does the job. > Of course a big case expression will also work ;-) > > Cheers > Serge > Hmmm.... The thing is that I have to replace some characters in a VARCHAR field. For example: ? (C with a caron) goes into CHR(219). I'm not sure quite what are you talking about. Best regards, Kovi -- -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
From: Serge Rielau on 27 Oct 2006 15:05
Gregor Kova? wrote: > Serge Rielau wrote: > >> Serge Rielau wrote: >>> Gregor Kovac( wrote: >>>> Hi! >>>> >>>> Does DB2 handle extended ASCII table? >>>> Example: >>>> VALUES(CHR(65)) => A >>>> VALUES(CHR(129)) => null, but according to www.asciitable.com should be >>>> u with umlaut. >>>> >>>> Any idea ? >>> I quote from the URL: >>> The _most_popular_ is presented below. >>> For single byte code pages I don't see a reason not to support all 255 >>> characters and do whatever the DB code page mandates. >>> >>> Anyway, the easiest workaround is probably to imply write a trivial UDF >>> in C/Java/CLR which does the job. >> Of course a big case expression will also work ;-) >> >> Cheers >> Serge >> > > Hmmm.... > > The thing is that I have to replace some characters in a VARCHAR field. > For example: ? (C with a caron) goes into CHR(219). I'm not sure quite what > are you talking about. > > Best regards, > Kovi CREATE FUNCTION extendedchr(arg INT) RETURNS CHAR(1) RETURN CASE WHEN arg BETWEEN 0 AND 127 THEN CHR(arg) WHEN arg = 219 THEN '?' END Wouldn't that work? -- Serge Rielau DB2 Solutions Development IBM Toronto Lab IOD Conference http://www.ibm.com/software/data/ondemandbusiness/conf2006/ |