Example: All Castings For A UDT That Has A Single Casting Pair - 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
ft:locale
en-US
ft:lastEdition
2024-12-13
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

The following example reports both the source and target castings for the UDT named address:

     HELP CAST address;

Result:

Source       Target           Cast Routine           As Assignment
----------------------------------------------------------------------
address      VARCHAR(80)      address_2_char             YES
VARCHAR(80)  address          char_2_address             YES
Note the following things about this report:
  • The castings from address to VARCHAR(80) and from VARCHAR(80) to address are complementary to one another.
  • Both casting routines are user-defined, which you can tell because neither is named System.
  • This UDT has only one casting pair defined for it, neither of which is named System, which suggests that it is probably a structured type.

    Castings for structured types are never system-generated, while the system always generates default casts for distinct types. Because it is also possible to drop the system-generated casts for a distinct UDT and replace them with user-defined casts, the inference that the casting reported in this example is for a structured UDT cannot be made with certainty. See CREATE CAST and REPLACE CAST for details.