Quote:
You have to handle the error in program that receives the result set.
The procedure below fetch first row within the procedure body, and the
handler is activated. |
Be careful. As coded, that procedure will consume the first row of the
result set - which will not be returned back to the calling
application. There's no way to push back a row into the result set, so
you'll have to either
a) declare another cursor for the express purpose of checking for the
57016 state.
b) return the value you just fetched in an OUT parameter, and have the
calling application be aware of that.
Personally, I'd be more likely to scrap all that, and have the calling
application test for the 57016 condition.