Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DELETE with RETURNING clause

Colin'tHartJun 22 2006 — edited Jun 22 2006
Hi,

I have a big table 'big_table' with 2.3 billion records. I have another (relatively small) table with several 100 million records.

I need to:

DELETE FROM big_table WHERE (a, b, c, d) IN SELECT e, f, g, h FROM relatively_small_table WHERE <complex condition>;

Now I'd like to mark the records from relatively_small_table as processed. To date I don't do it this way; I do the select with a bulk collect (also grabbing the ROWID) and the delete with a forall statement. I then check SQL%ROWCOUNT and update relatively_small_table setting the processed flag to done.

Is there anyway that I can use a RETURNING clause to give me the ROWIDs from relatively_small_table in the above DELETE statement?

Thanks,

Colin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2006
Added on Jun 22 2006
4 comments
1,508 views