If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

Hi,
I am trying to delete about a million rows from a table using a pl/sql block but am getting an error ORA-01002: fetch out of sequence

Here is the sample of the block

1 declare
2 cursor selectfordelete is select * from test where region not in ('REGROLL','WWF','WWR','CON','
3 'CAN','LATAM','OWH','REGEAST','AFRME','ASPAC','EUR','OEH','OTH','NCI','WOUS','WOUSCON') for upd
4 begin
5 for i in selectfordelete loop
6 delete from test where current of selectfordelete;
7 commit;
8 end loop;
9* end;
10 /
declare
*
ERROR at line 1:
ORA-01002: fetch out of sequence
ORA-06512: at line 5