16.20.16.20 - 16.20 - Example - Teradata Vantage NewSQL Engine

Teradata Vantage™ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

Consider the following table definitions, where euro and us_dollar are UDTs:

CREATE TABLE euro_sales_table
   (euro_quarter INTEGER
   ,euro_region VARCHAR(20)
   ,euro_sales euro );
CREATE TABLE us_sales_table
   (us_quarter INTEGER
   ,us_region VARCHAR(20)
   ,us_sales us_dollar );

Assuming an appropriate cast definition exists for converting the euro UDT to a us_dollar UDT, the following statement performs a us_dollar UDT to euro UDT conversion:

INSERT INTO euro_sales_table
   SELECT us_quarter, us_region, CAST (us_sales AS euro) 
   FROM us_sales_table;