15.00 - Default Capabilities of Structured UDTs - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

Default Capabilities of Structured UDTs

Unlike the case for distinct UDTs, the system does not automatically generate any transform, ordering, or cast functionality for a structured UDT. You must explicitly provide these capabilities yourself by writing an external C or C++ routine and then creating the appropriate cast, ordering, and transform definitions using the following DDL statements:

  • CREATE CAST (see “CREATE CAST/ REPLACE CAST” on page 212).
  • Also see “Default Cast For a Structured UDT” on page 760.

  • CREATE ORDERING (see “CREATE ORDERING/ REPLACE ORDERING” on page 416).
  • Also see “Default Ordering For a Structured UDT” on page 761.

    If you are creating a structured UDT that might be used for a hash index definition, you must ensure that its ordering function never returns a null. If it does, Teradata Database aborts the request and returns an error to the requestor.

  • CREATE TRANSFORM (see “CREATE TRANSFORM/ REPLACE TRANSFORM” on page 694).
  • Also see “Default Transform Group For a Structured UDT” on page 761

    You must create explicit ordering and transform functionality for all structured UDTs that you create. If you attempt to specify a structured UDT as the data type for any column of any table, but you have not created ordering and transform functionality for that UDT, the system returns an error to the requestor.

    You are not required to create explicit casting functionality for a structured UDT; however, you must create a cast if the structured UDT is to perform in certain SQL expressions such as the USING modifier, or to participate in various loading operations such as Fastload and MultiLoad.

    “Enabling Full Functionality For a Structured UDT” on page 763 summarizes the implications for structured UDTs of this and the topics that follow by explaining which functionalities must be explicitly user‑defined before a newly created structured UDT can be used as the type of a column table.