Consuming Result Sets Created by Calling a Stored Procedure - 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ā„¢

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.