17.00 - method_clause - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

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 Teradata Vantage™ - SQL Data Definition Language Detailed Topics , B035-1184 :
  • “Function Identifiers”
  • “Function Name”
  • “Function Calling Argument”
  • “Function Name Overloading”
  • “Parameter Names and Data Types”
INSTANCE
The object is an instance method.
INSTANCE is the default.
CONSTRUCTOR
The object is a constructor method.
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.
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 Teradata Vantage™ - 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 Teradata Vantage™ - SQL External Routine Programming , B035-1147 .
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, …, P n. 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.
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 Vantage 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.
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. Vantage 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 Teradata Vantage™ - 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 [SYSUDTLIB.]UDT_name
Name of the UDT to which this method applies.
Do not specify this clause for a specific method.