External Stored Procedure Invocation | Teradata Vantage - 17.10 - External Stored Procedure Invocation - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

Invoking an external stored procedure in a CALL statement is no different from invoking a stored procedure.

Argument List

The arguments in the CALL statement must appear as comma-separated expressions in the same order as the list of parameters in the Java method.

The argument types of an external stored procedure in a CALL statement must either be compatible with the corresponding parameter declarations in the function declaration or must be types that are implicitly converted to the corresponding parameter types, according to implicit type conversion rules.

To pass an argument that is not compatible with the corresponding parameter type and is not implicitly converted by Vantage, the CALL statement must explicitly convert the argument to the proper type.

For information on data type conversions, see Teradata Vantageā„¢ - Data Types and Literals, B035-1143.

Invoking External Stored Procedures with TD_ANYTYPE OUT Parameters

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.

For detailed information, see External Stored Procedures That Use TD_ANYTYPE Arguments.

Nested Procedure Calls

When doing nested stored procedure calls only one of those procedures can be an external procedure.