DELETE with RETURNING clause
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