16.10 - Using a Distinct UDT - Teradata Database

Teradata Database SQL Fundamentals

Product
Teradata Database
Release Number
16.10
Release Date
June 2017
Content Type
Programming Reference
Publication ID
B035-1141-161K
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.

    Teradata Database 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 Teradata 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.