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: housekeeping database

Re: housekeeping database

From: rok <rok_at_MCI2000.com>
Date: Fri, 19 Jun 1998 03:28:23 GMT
Message-ID: <01bd9b32$7f044be0$130537a6@raghus-computer>


Try:

loop

	exit when sql%rowcount = 0;
 	delete from TABLE_A
 	where processed_i = 1 
 	and rownum < 10000;
	commit;

end loop;                   

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

Original text of this message

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