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

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
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.