Examples of Character Data in a CASE Expression: Example 3 - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢

One THEN/ELSE expression in the following query has a Unicode column. The query is successful and the result data type is UNICODE because the CASE expression contains 1 Unicode column and all other literals can be successfully translated to Unicode.

   SELECT i, CASE
               WHEN i=1 THEN column_u
               WHEN i=2 THEN 'abc'
               WHEN i=3 THEN 8
               WHEN i=4 THEN _KanjiSJIS'4142'XC
               ELSE 10
             END
   FROM table_1
   ORDER BY 1;