ADD METHOD - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

Add the instance method signature for the method named method_name to the definition of the UDT named UDT_name.

You cannot specify this option for an ARRAY or VARRAY type.

INSTANCE
The specification of INSTANCE is optional.
INSTANCE METHOD is the default.
CONSTRUCTOR
Add the constructor method signature for the method named method_name to the definition of the UDT named UDT_name.
SYSUDTLIB.
The specification of SYSUDTLIB is optional.
method name
You must use the CREATE METHOD statement to create the body for method_name before you can invoke it. See CREATE METHOD. See Teradata Vantage™ - SQL Fundamentals, B035-1141 for the rules for naming database objects.
data_type
The data type list for the method to be added.
SYSUDTLIB. UDT_name
The specification of SYSUDTLIB is optional.
You cannot specify a character server data set of KANJI1.
RETURNS data_type
The list of the data types returned by method_name.
You cannot specify this option for an ARRAY or VARRAY type.
RETURNS SYSUDTLIB.UDT_name
The specification of SYSUDTLIB is optional.
CAST FROM
The result type returned by the method that is to be converted to the type specified by the RETURNS clause.
Example:
  ...RETURNS DECIMAL(9,5) CAST FROM FLOAT...
data type
Whenever a LOB that requires data type conversion is passed to a method, the LOB must first be materialized for the conversion to take place.
SYSUDTLIB
Optional containing database name, which is always SYSUDTLIB.
UDT_name
Name of the UDT.
LANGUAGE
The code for the language in which the external routine for method_name is written:
  • C specifies the C language.
  • CPP specifies the C++ language.
You cannot specify this option for an ARRAY or VARRAY type.
PARAMETER STYLE
The parameter passing style for method_name.
  • SQL allows the code body to indicate null data.
This is the default parameter style.
  • TD_GENERAL does not allow the code body to indicate null data.
You cannot specify this option for an ARRAY or VARRAY type.
DETERMINISTIC
The method_name returns the same results for identical inputs.
You cannot specify this option for an ARRAY or VARRAY type.
NOT DETERMINISTIC
The method_name does not necessarily return the same results for identical inputs.
You cannot specify this option for an ARRAY or VARRAY type.
NO SQL
Specifies whether SQL language calls are permitted within the user-written external routine for method_name.
The only valid specification is NO SQL.
You cannot specify this option for an ARRAY or VARRAY type.