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

Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlplus: loop until no updates

Re: sqlplus: loop until no updates

From: Chrysalis <cellis_at_iol.ie>
Date: 1997/04/02
Message-ID: <3342657C.13A0@iol.ie>#1/1

It should be noted that Halvard's solution works only for updates whose <where> clause selects no rows. If rows are selected, they *will* be registered as updated, even if the old and new values are the same. The only certain way to detect whether any values have been changed is to select the rows first (for update) and to check the old value against the new value *prior* to updating.

Hope this helps.

Chrysalis.

ib wrote:
>
> LOOP
> UPDATE ...;
> EXIT when sql%rowcount = 0;
> END LOOP;
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Ilia Bashtanov
>
> iliab_at_mmc.ru
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Hallvard B Furuseth <h.b.furuseth_at_usit.uio.no> wrote in article
> <HBF.97Apr1211139_at_bombur2.uio.no>...
> > How do I do this?
> >
> > LOOP
> > UPDATE ...;
> > <EXIT if no changes in last update>;
> > END LOOP;
> >
> >
> > --
> > Hallvard
> >
Received on Wed Apr 02 1997 - 00:00:00 CST

Original text of this message

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