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: Using UPDATE with ROWNUM?

Re: Using UPDATE with ROWNUM?

From: Hasta <hasta_l3_at_hotmail.com>
Date: Sun, 1 Jul 2007 06:31:55 +0200
Message-ID: <MPG.20f14ca5410714c9989685@news.dommel.be>


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

Received on Sat Jun 30 2007 - 23:31:55 CDT

Original text of this message

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