15.10 - METHOD - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

Calling name for the method.

If the UDF library for your database contains any objects with multibyte characters in their name, you cannot use a single-byte session character set to create a new UDF, UDT, method, even if the new object name contains only single-byte characters. Instead, use a multibyte session character set. For related information about methods, see the following topics under "CREATE FUNCTION and REPLACE FUNCTION(External Form)" in SQL Data Definition Language - Detailed Topics, B035-1184 :
  • “Function Identifiers”
  • “Function Name”
  • “Function Calling Argument”
  • “Function Name Overloading”
  • “Parameter Names and Data Types”
method_name
method_name must match the spelling and case of its C/C++ method name exactly if you do not specify a specific_method_name or external_method_name. This applies only to the definition of the method, not to its use.
For information about naming database objects, see SQL Fundamentals, B035-1141.
Parameter data types and number of parameters are used to distinguish among different methods within the same class that have the same method_name.
For further information about function overloading, see SQL External Routine Programming, B035-1147.
SYSUDTLIB
method_name must be unique within the SYSUDTLIB database. You cannot give a method the same name as an existing method or any other database object contained within the SYSUDTLIB database.
INSTANCE
The object is an instance method.
INSTANCE is the default.
CONSTRUCTOR
The object is a constructor method.
data type
A parenthetical comma-separated list of data types and optional parameter names for the variables to be passed to the function.
The data type associated with each parameter is the type of the parameter or returned value. All Teradata Database predefined data types and UDTs are valid.
Character data can also specify a CHARACTER SET clause.
For data types that take a length or size specification, like BYTE, CHARACTER, DECIMAL, VARCHAR, and so on, the size of the parameter indicates the largest number of bytes that can be passed.
parameter_name
The maximum number of parameters a method accepts is 128.
You must specify opening and closing parentheses even if no parameters are to be passed to the function.
If you specify one parameter name, then you must specify names for all the parameters passed to the function.
If you do not specify parameter names, the system assigns unique names to them in the form P1, P2, …, Pn. These names are used in the COMMENT statement, displayed in the report produced by the HELP METHOD statement, and appear in the text of error messages. See COMMENT (Comment Placing Form) and HELP METHOD.
UDT_name
If you specify a UDT, the current user of the method must have one of the following privilege sets:
  • UDTMETHOD, UDTTYPE, or UDTUSAGE on the SYSUDTLIB database.
  • UDTUSAGE on the specified UDT.
AS LOCATOR
BLOB and CLOB types must be represented by a locator. Teradata Database does not support in-memory LOB parameters. You must specify an AS LOCATOR phrase for each LOB parameter and return value. For a description of locators, see SQL Data Manipulation Language, B035-1146.
Note, however, that whenever a LOB that requires data type conversion is passed to a method, the LOB must be materialized for the conversion to take place.
FOR UDT_name
Name of the UDT to which this method applies.
Do not specify this clause for a specific method.
SYSUDTLIB
Optional specification of containing library.