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