Creating Parallel Cast and Transform Functionality | Teradata Vantage - Creating Parallel Cast and Transform Functionality - 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™

For best practice, pair transform group functionality with the equivalent cast functionality. See CREATE TRANSFORM and REPLACE TRANSFORM. Create parallel functionalities for the two conversion types, for example:

Cast Functionality Equivalent Transform Functionality
External predefined data type to UDT cast External predefined data type to UDT tosql transform
UDT to external predefined data type cast UDT to external predefined data type fromsql transform

This is highly recommended if you want to use a UDT in the same way you would use any other data type. Especially in regard to load utilities and the USING row descriptor, it is recommended that the type developer back up their tosql and fromsql functionality with equivalent external type (predefined) to UDT and UDT to external type (predefined) implicit casts, respectfully.

For equivalence, you can reference the same external routines in the CREATE TRANSFORM and CREATE CAST statements for the same UDT.

The following table describes the differences for distinct and structured UDTs:

FOR this kind of UDT … You must do the following work to create parallel casting and transform functionality…
distinct none if you plan to use the system-generated casts and transforms.

However, if you decide to write your own external cast and transform routines for the UDT, you must create the parallel cast and transform functionalities explicitly using the CREATE CAST and CREATE TRANSFORM statements, respectively.

structured create the necessary casts and transforms explicitly, using the same external routines for both.

For more information, see CREATE CAST and REPLACE CAST and CREATE TRANSFORM and REPLACE TRANSFORM .