Name of the distinct UDT to be created.
For information about naming database objects, see Teradata Vantage™ SQL Fundamentals, B035-1141.
See Teradata Vantage™ SQL Fundamentals, B035-1141 for the rules for naming database objects.
Creating a distinct type consumes two names in the TVMNameI name space for SYSUDTLIB:
- The first name consumed corresponds to the name of the UDT itself.
- The second name corresponds to the system-generated UDF.
The system constructs this name as explained in the topic on naming conventions.
You cannot create a UDF within the SYSUDTLIB database with the same specific name or same routine signature.
If such a UDF already exists in SYSUDTLIB at the time you submit a CREATE TYPE request, then the request fails because a routine with the same signature already exists.
- An optional specification of the containing database for UDT_name, which must always be SYSUDTLIB.
Example: Creating a Distinct UDT for Euro Conversion
The following example creates a distinct UDT named euro based on the source data type DECIMAL(8,2):
CREATE TYPE euro AS DECIMAL(8, 2) FINAL METHOD toUS() RETURNS us_dollar CAST FROM DECIMAL(8,2) LANGUAGE C DETERMINISTIC NO SQL RETURNS NULL ON NULL INPUT; …
Example: Creating a Distinct UDT for Dollar Conversion
The following example creates a distinct UDT named us_dollar based on the source data type DECIMAL(8,2):
CREATE TYPE SYSUDTLIB.us_dollar AS DECIMAL(8, 2) FINAL METHOD toEuro() RETURNS euro CAST FROM DECIMAL(8,2) LANGUAGE C DETERMINISTIC NO SQL RETURNS NULL ON NULL INPUT;