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

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1184-162K
Language
English (United States)

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.