17.10 - Consuming Result Sets Created by Calling a Stored Procedure - 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)

An external stored procedure that uses CLIv2 to directly execute SQL can call a stored procedure that creates up to 15 dynamic result sets.

To indicate that the external stored procedure is willing to consume result sets created by a stored procedure, the SQL request that contains the CALL statement must set the Dynamic Result Sets Allowed option in the DBCAREA to 'Y'.

Here is a code excerpt for a request that calls a stored procedure called sp1:

...
dbcarea.change_opts                 = 'Y';
dbcarea.dynamic_result_sets_allowed = 'Y'; 
dbcarea.req_ptr                     = "CALL sp1('SEL * FROM t1');";
...

For a complete code example, see Using CLIv2 to Consume Dynamic Result Sets. You can use the code example to see the types of parcels in a response that Vantage returns to the caller of a stored procedure that creates result sets.