Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: **PLEASE HELP** Oracle Stored Procedures question
Could you solve this problem by using a package ?
Create a global variable in the package to determine the state of the cursor. Initialize this variable to "closed". Global variables will persist for the entire transaction regardless of how many times you call the procedure.
Define function (within the package) get_data which returns one row of data, with the cursor status as it's value (or a proc with an extra out parameter).
get_data would look something like this. (pseudo code)
If cursor not open -- Test Global Variable Then
Open cursor set cursor status variable = open
fetch data
If last row then
close cursor return last row status else return more data status
exit Received on Wed May 21 1997 - 00:00:00 CDT
![]() |
![]() |