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

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with exception handling

Re: Problem with exception handling

From: John Bester <johnb_at_iconnect.co.za>
Date: Fri, 17 Jul 1998 16:13:44 +0200
Message-ID: <35afdaf0.0@informer.hixnet.co.za>


I would suggest writing another procedure that contains the body of the loop and do the exception handling in it.

procedure InsertSomeField(somefield);
begin

        insert into sometable somefield;
        commit;
    exception
        when others do
            insert into errortable 'Some error message';
end;

procedure My Proc;
begin

    for c1rec in c1 loop

        InsertSomeField(c1rec.somefield)     end loop;
end;

---
John Bester
johnb_at_iconnect.co.za

Ivan Bajon wrote in message <6ondee$95k$1_at_news1.tele.dk>...
>I'm trying to make a procedure resume after an exception has been raised.
>The situation is more or less like this:
>
>procedure My Proc;
>begin
> for c1rec in c1 loop
>/* c1 is my cursor */
> insert into sometable c1rec.somefield;
> commit;
> end loop;
> exception
> when others do
> insert into errortable 'Some error message';
>end;
>
>Lets say c1 yields 1000 records and that an exception occur in the 500th
>insert. How do I make it resume and do the last 500 inserts after handling
>the exception?
>
>Any help appreciated.
>- Ivan Bajon NOCP (Not Oracle Certified Professional)
>
>
>
Received on Fri Jul 17 1998 - 09:13:44 CDT

Original text of this message

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