Error Conditions - 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
ft:locale
en-US
ft:lastEdition
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢

The following conditions or expressions are considered illegal in a CASE expression:

Condition or Expression Example
A condition after the keyword CASE is supplied.
SELECT CASE a=1
        WHEN 1
        THEN 1
        ELSE 0
        END
FROM t;
A non valid WHEN expression is supplied in a valued CASE expression.
SELECT CASE a
        WHEN a=1
        THEN 1 
        ELSE 0 
       END 
FROM t;
A non valid WHEN condition is supplied in a searched CASE expression.
SELECT CASE 
        WHEN a
        THEN 1 
        ELSE 0 
       END 
FROM t;
SELECT CASE
        WHEN NULL
        THEN 'NULL'
       END
FROM table_1;
A non-scalar subquery is specified in a WHEN condition of a searched CASE expression.
SELECT CASE 
        WHEN t.a IN 
         (SELECT u.a 
          FROM u)
        THEN 1 
        ELSE 0 
       END 
FROM t;
A CASE expression references multiple UDTs that are not identical to each other.
SELECT CASE t.shape.gettype()
        WHEN 1 
        THEN NEW circle('18,18,324')
        WHEN 2
        THEN NEW square('20,20,400')
       END;