17.10 - Using a Distinct UDT - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1141-171K
Language
English (United States)
Here is a synopsis of the steps you take to develop and use a distinct UDT:
  1. Use the CREATE TYPE statement to create a distinct UDT that is based on a predefined data type, such as INTEGER or VARCHAR.

    Vantage automatically generates functionality for the UDT that allows you to import and export the UDT between the client and server, use the UDT in a table, perform comparison operations between two UDTs, and perform data type conversions between the UDT and the predefined data type on which the definition is based.

  2. If the UDT defines methods, write, test, and debug the C or C++ code for the methods, and then use CREATE METHOD or REPLACE METHOD to identify the location of the source code and install it on the server.

    The methods are compiled, linked to the dynamic linked library (DLL or SO) associated with the SYSUDTLIB database, and distributed to all database nodes in the system.

  3. Use GRANT to grant privileges to users who are authorized to use the UDT.
  4. Use the UDT as the data type of a column in a table definition.