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: Commit in an open cursor

Re: Commit in an open cursor

From: Peter Kellner <peter_at_kellner.com>
Date: Wed, 10 Nov 1999 06:04:49 GMT
Message-ID: <38290ae7.88234376@news.pacbell.net>


according the oracle pl/sql book, this is no problem. You are right about the "for update" causing problems.

On Wed, 10 Nov 1999 04:59:19 GMT, "Hisham Douba" <hdouba_at_netscape.net> wrote:

>Hi Everybody,
>
>Is it valid to have a commit in an open cursor? My code looks like
>
>declare
> cursor cur1 is select * from emp;
> counter number;
>begin
> counter := 0;
> for rec in cur1 loop
> counter := counter + 1;
> insert into emp2 values (rec.no, rec.name);
> if counter > 4000 then
> commit;
> counter := 0;
> end if;
> end loop;
>exception
> when others then
> return 'error';
>end;
>
>Please note that the select is not for update.
>
>Your comments are very appreciated.
>
>Hisham
>
>
Received on Wed Nov 10 1999 - 00:04:49 CST

Original text of this message

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