Can we reset a cursor to first row
707262Jun 22 2009 — edited Jun 23 2009Hello
Is it possible that we reset a cursor to first row after reaching last row?
I want to do something like this
DECLARE
cur SYS_CURSOR;
queryContext DBMS_XMLGEN.ctxHandle;
result CLOB;
BEGIN
OPEN cur FOR seq.nextval tid, testcol1 FROM testtable;
queryContext := DBMS_XMLGEN.newContext(cur);
result := DBMS_XMLGEN.getXML(queryContext);
DBMS_XMLGEN.closeContext(queryContext);
-- The cursor is at end of record set, I need to go back to first row and insert the data into a table
RESET cur; -- No such command exist, just an idea
LOOP
-- insert each row in table
END LOOP;
CLOSE cur;
END;
I could query again with same select statement if I had not had generated a value from a sequence.
Omer