Discarding Results from Within a Stored Procedure

Discarding Results from Within a Stored Procedure

Post by niel.. » Fri, 22 Dec 2000 09:09:07

We wrote a stored procedure which performs a task and then returns a
single value in the form of an output parameter.  In the course of
performing the task, the procedure executes a SELECT statement.
Though we did not intend the procedure to return the selected rows to
its C++ caller, we found that the output parameter value was not visible
to him until he had retrieved (or discarded) those rows.

This is very confusing to any caller who is invoking a stored procedure
for the sole purpose of getting values from one or more output
parameters.  He doesn't know (and shouldn't have to know) how the value
was determined (a SELECT was executed) and shouldn't have to cope with
the side effects (retrieve or discard the selected rows).  My question:
Is there a way to "discard" rows from within a stored procedure when it
is not intended that the rows be returned to the caller?

Thanks for any help.

Sent via Deja.com


1. Retrieving result from a stored procedure called within another stored procedure


I have a stored procedure I created that is calling another stored procedure
another application which returns a result set.  So keep in mind I can't
modify the
stored procedure I am calling.

I am trying to access the result set produced by the called stored procedure
my stored procedure.

Is there any other way to retrieve these results other than dumping them
a temp table?


2. Log Shipping Resync

3. Using query results within a stored procedure

4. Little Data base

5. How do I retrieve the results of a dynamic query within a store procedure

6. Creating a record for each field in a row? Can it be done?

7. Using Query Results within Stored Procedure

8. DBA_FREE_SPACE, how to create ?

9. Reusing Query Result Rowsets within a Stored Procedure

10. Calling a Stored Procedure from within a Stored Procedure

11. executing system stored procedures within a stored procedure

12. Calling a stored procedure from within a stored procedure