Restrictions on the Data Types in a CASE Expression - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢

The following restrictions apply to CLOB, BLOB, and UDT types in a CASE expression:

Data Type Restrictions
BLOB A BLOB can only appear in value_expression_1, value_expression_n, scalar_expression_m, or scalar_expression_n when it is cast to BYTE or VARBYTE.
CLOB A CLOB can only appear in value_expression_1, value_expression_n, scalar_expression_m, or scalar_expression_n when it is cast to CHAR or VARCHAR.
UDT Multiple UDTs can appear in a CASE expression, with the following restrictions:
  • The data type of value_expression_1 through value_expression_n must have the same UDT data type if one of them has a UDT data type.
  • scalar_expression_n and scalar_expression_m must be the same UDT data type if one them has a UDT data type.

Vantage does not perform implicit type conversion on UDTs in CASE expressions. A workaround for this restriction is to use CREATE CAST to define casts that cast between the UDTs, and then explicitly invoke the CAST function in the CASE expression. For more information on CREATE CAST, see Teradata Vantageā„¢ - SQL Data Definition Language Syntax and Examples, B035-1144.