Restrictions on the Data Types in a CASE Expression

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

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.

Teradata Database 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.