Example: Specifying UDTs in the SELECT List and WHERE Clause of SELECT Statements - Analytics Database - Teradata Vantage

SQL Data Manipulation Language

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-04-05
dita:mapPath
pon1628111750298.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
esx1472246586715
lifecycle
latest
Product Category
Teradata Vantage™

The following set of simple examples shows the valid use of UDT expressions in a SELECT statement:

     SELECT euro_column
     FROM t1;

     SELECT euro_column.roundup(0)
     FROM t1;

     SELECT address_column.street(), address_column.zip()
     FROM t2;

     SELECT t.address_column.ALL
     FROM t2 AS t;

     SELECT address_column
     FROM t2
     WHERE address_column.zip() = '92127';
    
     SELECT *
     FROM t3
     WHERE circle_column = NEW circle(1.34, 4.56, 10.3);

     SELECT circle_column.area()
     FROM t3;

The following example shows the need to cast the distinct UDT column named myDollar to compare it with a DECIMAL value.

     SELECT *
     FROM t4
     WHERE myDollar < (CAST 3.20 AS DollarUDT);