Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> avoid fetch out of sequence error

avoid fetch out of sequence error

From: gdog <rana_gman_at_hotmail.com>
Date: 12 Oct 2004 16:39:24 -0700
Message-ID: <c2e65d67.0410121539.372871b5@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US