Using a Distinct UDT - Advanced SQL Engine - Teradata Database

SQL Fundamentals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
zwv1557098532464.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1141
lifecycle
previous
Product Category
Teradata Vantageâ„¢
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.