Example: UDT-to-Numeric Conversion - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Consider the following table definition, where euro is a UDT:

CREATE TABLE euro_sales_table
   (quarter INTEGER
   ,region VARCHAR(20)
   ,sales euro );

Assuming an appropriate cast definition exists for the euro UDT, the following statement converts the values in the sales column to DECIMAL(10,2):

SELECT SUM (CAST (sales AS DECIMAL(10,2))) FROM euro_sales_table;