Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: housekeeping database
Try:
loop
exit when sql%rowcount = 0; delete from TABLE_A where processed_i = 1 and rownum < 10000; commit;
Ong Chin Hui <chong_at_hq.psa.com.sg> wrote in article
<35889091.70540277_at_butler.psa>...
> I am trying to a Oracle sql script to do some housekeeping but I am
> not very familiar with PL/SQL.
>
> What I want to achieve is something like this :
>
> delete from TABLE_A where processed_i = 1
>
> However, I keep getting "rollback segment too small" problem as the
> table is quite huge.
>
> So I am thinking of doing something like
>
> do
> {
> delete from TABLE_A
> where processed_i = 1
> and rownum < 10000;
>
> get the rowcount for the delete
>
> } while (rowcount != 0)
>
> How can I do this in Oracle ? Pls help.
>
Received on Thu Jun 18 1998 - 22:28:23 CDT