Commenting on UDT and Method Definitions - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

The following example set shows how to place comments on a UDT or method:

UDT and Method Definitions for Examples

Suppose you define the following UDT and method.

    CREATE TYPE address AS (
      street VARCHAR(20), 
      zip CHARACTER(5) ) 
    NOT FINAL
    CONSTRUCTOR METHOD address( a VARCHAR(20), 
                                b CHARACTER(5) ) 
    RETURNS address
    SPECIFIC address_constructor_1
    SELF AS RESULT
    LANGUAGE C
    PARAMETER STYLE SQL
    DETERMINISTIC
    NO SQL;
    CREATE CONSTRUCTOR METHOD address( VARCHAR(20), 
                                       CHARACTER(5) )
    RETURNS address
    FOR address
    EXTERNAL NAME 
      'SO!C:\structured_lib\addr_cons.obj!F!addr_constructor';

Example: Commenting on a UDT Definition

The following request places a comment on the UDT named address:

    COMMENT ON TYPE address   
    AS   'Type containing the Street Address and Zipcode' ;

Because the object kind for this request is TYPE, you must specify the keyword TYPE for the object kind when you code it.

Example: Commenting on a Method Definition

The following request places a comment on the constructor method named address_constructor_1:

    COMMENT ON METHOD address_constructor_1  
    AS   'Constructor for the Address UDT'  ;

Because the object kind for this request is METHOD, you must specify the keyword METHOD for the object kind when you code it.

Also note that the method name must specify the specific name of the method rather than its calling name. See CREATE METHOD for further information about the calling name and the specific name for a method.