How to reset a cursor in PL/SQL?
630622Apr 10 2008 — edited Apr 10 2008Hi everyone
I have a CURSOR in PL/SQL with a number N of rows. I fetch all these rows in a bucle, but, when the last row is arrived, and the condition NOTFOUND is true, I'd like to return to the first row, and do the same process again. I mean, fetching every row a number of times k. For example, in a cursor of 3 rows:
Row 1
Row 2
Row 3
Row 1
Row 2
... and on
If I close the cursor and then I open it, there is no data, because the cursor is in the last row and the FETCH return NOTFOUND, so I'd like to "reset" the cursor and begin from the first row again.
How could I do this?
Thank you very much and sorry for my english