ADD METHOD - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-22
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
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.