Example: All Castings For A UDT That Has Multiple Casting Pairs - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

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
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

The following example extends CREATE CAST and REPLACE CAST to show what the output of running HELP CAST euro (see CREATE CAST and REPLACE CAST and CREATE CAST and REPLACE CAST) with no options:

     HELP CAST euro;

Result:

Source         Target         Cast Routine           As Assignment
----------------------------------------------------------------------
euro           DECIMAL(10,2)  System                     YES
DECIMAL(10,2)  euro           System                     YES
us_dollar      euro           UstoEuro                   YES
euro           us_dollar      EurotoUS                   NO

Note the following things about this report:

  • Because this UDT has two casting pairs (euro:DECIMAL and euro:us_dollar), there are four rows in the report.
  • The euro:DECIMAL casting pair was system-generated (which you can tell because its cast routine in both cases is named System), while the euro:us_dollar casting pair was user-defined.
  • There is no implicit casting for the euro-to-us_dollar cast because it was not defined with the AS ASSIGNMENT option.