Returning Result Sets from a Stored Procedure - Teradata Database

Teradata Database SQL Stored Procedures and Embedded SQL

Teradata Database
Programming Reference

You can use the DYNAMIC RESULT SETS clause in the CREATE/REPLACE PROCEDURE statement to return up to 15 result sets to the caller (an external stored procedure) or client (an application such as BTEQ) of the stored procedure. The stored procedure returns result sets in the form of a multistatement response spool.

The stored procedure assumes zero result sets if the clause is absent. The stored procedure may return no result sets, or fewer result sets than specified by the DYNAMIC RESULT SETS clause.

This clause is optional. Do not use it if you do not want the stored procedure to return result sets.

For information on reading result sets in an external stored procedure, see SQL External Routine Programming.