Restrictions on the Data Types in a CASE Expression - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
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.