External Stored Procedures That Use TD_ANYTYPE Arguments - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

You can define external stored procedures with IN, INOUT, or OUT parameters that are of TD_ANYTYPE data type.

The guidelines for defining external stored procedures that use TD_ANYTYPE arguments are similar to the guidelines for defining scalar UDFs that use TD_ANYTYPE arguments. For details, see Defining C/C++ Functions that Use the TD_ANYTYPE Type.

When invoking an external stored procedure that is defined with a TD_ANYTYPE OUT parameter, you can specify the RETURNS data type or RETURNS STYLE column expression clauses along with the OUT argument in the CALL statement to indicate the desired return type of the OUT parameter. The column expression can be any valid table or view column reference, and the return data type is determined based on the type of the column.

The RETURNS or RETURNS STYLE clause is not mandatory as long as the procedure also includes a TD_ANYTYPE input parameter. If you do not specify a RETURNS or RETURNS STYLE clause, then the data type of the first TD_ANYTYPE IN or INOUT argument is used to determine the return type of the OUT parameter. For character types, if the character set is not specified as part of the data type, then the default character set is used.

The RETURNS and RETURNS STYLE clauses are only used to set the return type for a TD_ANYTYPE OUT parameter. The data type of a TD_ANYTYPE INOUT parameter is determined by the data type of the corresponding input argument.