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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Forall limit

Re: Forall limit

From: Connor McDonald <mcdonald.connor_at_gmail.com>
Date: Fri, 13 May 2005 08:33:17 +0800
Message-ID: <5e3048620505121733748480c3@mail.gmail.com>


Assuming you are fetching the records from somewhere in the first place you would do something like:

open cursor
loop
  bulk collect limit 500 into r
  forall i in 1 .. r.count

     delete...
  exit when r.count < 500
end loop
close cursor

Of course, ideally you might be better off just with "delete where ... "

hth
connor

On 5/12/05, cichomitiko gmail <cichomitiko_at_gmail.com> wrote:
> Thank you!
> May be I have to try something like:

>=20

> FORALL e IN 1..1000 -- bulk-bind first part of varray
> DELETE PUSH_LIST_DELIVERY
> WHERE ID_MSG_LIST=3Dt_ID_MSG_LIST(e);
>=20
> FORALL e IN 1001..cont_tot -- bulk-bind the rest of varray
> DELETE PUSH_LIST_DELIVERY
> WHERE ID_MSG_LIST=3Dt_ID_MSG_LIST(e);
>=20

> But I have to control the number of recors returned, so for example, if i=
t's
> 3000, then it should be:

>=20

--=20
Connor McDonald
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
email: connor_mcdonald_at_yahoo.com
web: http://www.oracledba.co.uk

"Semper in excremento, sole profundum qui variat"

--
http://www.freelists.org/webpage/oracle-l
Received on Thu May 12 2005 - 20:37:52 CDT

Original text of this message

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