Example: All Castings For A UDT That Has Multiple Casting Pairs - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
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;

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.