Error: ORA-01001: invalid cursor
583872Feb 26 2008 — edited Feb 27 2008Hi,
I am writing a procedure which fetches from a cursor, closes the cursor and then does something with the results.
First I call another procedure which returns me the cursor.
I then try to fetch from the cursor using:
LOOP
FETCH l_resultset BULK COLLECT INTO tag_result_rec;
EXIT WHEN l_resultset%NOTFOUND;
END LOOP;
This is where the error is being raised. I first thought that the procedure which brings me back the resultset may not be passing back the cursor open. I checked and found that the procedure was opening the cursor and ran through to the end. This procedure does not close the cursor.
I then inserted the following check to see if the cursor was open before the fetch I am trying above.
IF l_resultset%ISOPEN THEN
dbms_output.put_line('test 1');
END IF;
When running the procedure, the output message did print so the cursor is open.
So any explanations as to why the invalid cursor is being raised?
Thanks in advance for any assistance.