Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> avoid fetch out of sequence error
Hello,
I'm getting this error (ORA-01002 fetch out of sequence) while i'm executing this kind of logic in a stored procedure;
procedure do_insert_rec()
is
begin
declare cursor a is select * from .........
arec a%rowtype;
begin
open cursor a;
loop
fetch cursor a into arec; exit when a%nofound;
do_proc_a; <-- this procedure inserts a record, but record is not committed. stmts; declare cursor b is select * from ......... brec b%rowtype; begin open cursor b; loop fetch cursor b into brec; exit when b%nofound; do_proc_b; <-- with in this procedure call, if a rollback stmt is is issued, i get the ora-01002 error when it goes to fetch the next record. This never happened in 8i version; happens in 9i version. stmts; stmts; end loop; close b; end;
end loop;
close a;
end;
Received on Tue Oct 12 2004 - 18:39:24 CDT