16.20 - RETURNS data type - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

The predefined data type or UDT for the value returned by the method.

The method is responsible for providing the returned data with the correct type. If the return type is difficult for the method to create, you should also specify a CAST FROM clause so the system can perform the appropriate data type conversion. For more information about using CAST expressions, see Teradata Vantage™ SQL Functions, Expressions, and Predicates, B035-1145.

The result type has a dictionary entry in DBC.TVFields under the name RETURN0 [n], where n is a sequence of digits appended to RETURN0 rows to make each value unique, ensuring that no user-defined parameter names are duplicated. The value of n is incremented until it no longer duplicates a parameter name.

If there is no parameter name of RETURN0, then the n subscript is not used.

If the external routine for the method is written in C or C++, you can specify TD_ANYTYPE as a parameter data type.

See the CREATE FUNCTION/REPLACE FUNCTION topic “Returns Clause” in Teradata Vantage™ SQL Data Definition Language Detailed Topics , B035-1184 .

This clause is optional.

If you specify a RETURNS clause, it must be the same as the RETURNS clause specified for the corresponding CREATE TYPE.

If you do not specify a RETURNS clause for the method, then the RETURNS clause specified for the corresponding CREATE TYPE applies to this method by default.