Example

Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

Consider the following table definitions:

   CREATE TABLE table_1
     (ckanji1 VARCHAR(20) CHARACTER SET KANJI1);
   
   CREATE TABLE table_2
    (cunicode CHARACTER(20) CHARACTER SET UNICODE);

Assume table_1 is populated from the KanjiEUC client character set.

To translate the data in ckanji1 in table_1 to UNICODE, and populate table_2 with translations that have no errors, use the following statement:

   INSERT INTO table_2
   SELECT TRANSLATE(ckanji1 USING Kanji1_KanjiEUC_TO_Unicode)
   FROM table_1
   WHERE TRANSLATE_CHK(ckanji1 USING Kanji_KanjiEUC_TO_Unicode) = 0;