Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using UPDATE with ROWNUM?
In article <1183215467.136012_at_bubbleator.drizzle.com>,
damorgan_at_psoug.org says...
> Subject: Re: Using UPDATE with ROWNUM?
> From: DA Morgan <damorgan_at_psoug.org>
> Newsgroups: comp.databases.oracle.server
>
> Hasta wrote:
> > In article <1183151689.328262_at_bubbleator.drizzle.com>,
> > damorgan_at_psoug.org says...
> >> Hasta wrote:
> >>
> >>> But why would the OP get ora-1555, Joel (and Frank and Daniel) ?
> >>>
> >>> He is not commiting in a cursor loop, afaics
> >>>
> >>> begin
> >>> loop
> >>> update (select seq_no from mytable) set seq_no = tempseq.nextval
> >>> where rownum <= 1000;
> >>> exit when SQL%FOUND = false;
> >>> commit;
> >>> end loop;
> >>> end;
> >>>
>
>
> But now, having looked at the statement very closely, I have
> another comment to make ... what is it that prevents the
> loop from updating the exact same 1000 rows ad infinitum?
Indeed, Daniel, that was - kind of - the OP's question, which was answered by Chris and Jagjeet
I should have posted Jagjeet's answer, but that one also had a bug (typed in too quickly, I guess) and I wanted to focus on ORA-1555...
Take care