Displaying the results of a stored procedure task

If the task that was executed is a stored procedure, you can use the ADMIN_TASK_OUTPUT table function to display the output parameter values and result sets.

Before you begin

To call this user-defined table function, you must have MONITOR1 privilege.

About this task

If the task that was executed is not a stored procedure, the ADMIN_TASK_OUTPUT table function returns an empty table. Also, if the SYSIBM.ADMIN_TASKS_HIST table is not accessible (for example, if the Db2 subsystem is down), the output of previous executions are not available to the ADMIN_TASK_OUTPUT table function and an empty table is returned.

Procedure

To display the results of a stored procedure task:

Call the ADMIN_TASK_OUTPUT table function.
This user-defined table function returns up to one row for each output parameter of the stored procedure and up to one row for each column value of each row of each result set of the stored procedure. If the output values and the result set values are too large to be stored in the OUTPUT column of the SYSIBM.ADMIN_TASKS_HIST table, only the last rows of the result sets are returned. The column and parameter values are returned as strings.