17.05 - Example: Specifying UDTs in the SELECT List and WHERE Clause of SELECT Statements - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Advanced SQL Engine
Teradata Database
Release Number
Release Date
January 2021
Content Type
Programming Reference
Publication ID
English (United States)

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);