When processing the results of some stored procedures, the
desired results may be in the second or third result set.
I would like to be able to turn one or all of the result
sets into cursors within a stored procedure of my own
creation. The cursor syntax seems to want a select
statement, so I can insert data from the first returned
result set into a temporary table and then turn a select
statement on the temporary table into a cursor. This
method only allows data from the first returned result set
to be used.
A related problem is discarding the data sets that are not
needed so the user only receives one final result. I
believe this problem can be solved by putting all the
possible result sets into cursors that may or may not be
used, but a more elegant solution is desired.