Consuming Result Sets Created by Calling a Stored Procedure - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.