Re: Pro*C Delete help

From: LMayhew <lmayhew_at_aol.com>
Date: 20 Dec 1994 01:02:21 -0500
Message-ID: <3d5s1d$8ks_at_newsbf02.news-fddi.aol.com>


>I use a cursor to read the rows of a table. After I read a row
>I would like to delete it.
>If that is not possible I would like to delete all the rows in
>the table after I have read them all.
 

>Can anyone tell me how to do this?

If you add to your select.... the ROWID variable and the FOR UPDATE OF clause like ...

select name, addr, ... ROWID
from employee
for update of name;

Then you can delete the row by using the ROWID variable ...

delete from EMPLOYEE where rowid = :srowid;

Be sure and commit a few records as you go or you will run out of locks or enqueues... this is because the SELECT FOR UPDATE clause uses row locking...

Lee Mayhew Received on Tue Dec 20 1994 - 07:02:21 CET

Original text of this message