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.
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.
CAST FROM
The result predefined data type returned by the external function that is to be converted to the type specified by the RETURNS clause.

For example:

...RETURNS DECIMAL(9,5) CAST FROM FLOAT...
You cannot specify a character server data set of KANJI1. Otherwise, the system returns an error to the requestor.
Whenever a LOB that requires data type conversion is passed to a method, the LOB must first be materialized for the conversion to occur.
specific_method_name
Specific name of the method whose signature is being added to the type definition for UDT_name. Optionally, you can specify containing database name, which is SYSUDTLIB.
SELF AS RESULT
Specifies that 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.