× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



All,

Was trying to help this poster to Stack Exchange..
https://stackoverflow.com/questions/31819088/db2-sql-interpret-a-field-as-other-ccsid

I created a test file with a single field named test withh a CCSID of 13488.

The DB is perfectly happy with this:

SELECT hex(substr(test,7,3))
, cast(substr(test,7,3) as char (3) CCSID 37)
FROM wiltc/test

But this:
SELECT hex(substr(test,1,6))
, cast(substr(test,1,6) as nchar)
FROM wiltc/test

returns
SQL0332 - Character conversion between CCSID 65535 and CCSID 1200 not valid

This also returns an SQL0332
SELECT hex(substr(test,1,6))
, cast(substr(test,1,6) as char (6) CCSID 13488)
FROM wiltc/test


It seems to me that if the DB is going to allow any cast from 65535, it
should allow them all.

Charles

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.