method_specification - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™
INSTANCE
The method signature being defined is an instance method.
This is the default.
CONSTRUCTOR
The method signature being defined is a constructor method.
SYSUDTLIB
An optional keyword that indicates that method_name is being created in the SYSUDTLIB database.
All methods must be created within the SYSUDTLIB database.
method_name
Name for the method whose signature being added to the type definition for UDT_name.
For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
AS LOCATOR
Specifies that a BLOB or CLOB parameter type is represented by a locator. For a description of locators, see Teradata Vantage™ - SQL Data Manipulation Language, B035-1146. LOB parameters must always be represented by a locator. Vantage does not support in-memory LOB parameters: an AS LOCATOR phrase must be specified for each LOB parameter and return value.
Whenever a LOB that requires data type conversion is passed to a method, the LOB must be materialized for the conversion to take place.
CAST FROM
The result type returned by the external function 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.
UDT_name
Name of the UDT.
specific_method_name
Specific name of the method whose signature is being added to the type definition for UDT_name.
SELF AS RESULT
The method is type-preserving.
If you specify SELF AS RESULT, then the data type specified in the RETURNS clause for the method must have the same name as UDT_name.