Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Commit in an open cursor
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