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!

count records deleted with FORALL

Roger25Dec 13 2014 — edited Dec 15 2014

Hi,

I have a pl/sql script which deletes using bulk processing, 2 million of rows from a table. It deletes something like

  FORALL i IN v_id_tab.first .. v_id_tab.last save exceptions

    DELETE FROM my_table

    WHERE id = v_id_tab(i);

Where v_id_tab is a variable of a type which holds the ID-s to be deleted.

I want to know how many records were deleted, and I saw it's possible to see on each iteration how many rows were processed, like here: Live ORACLE: Using %BULK_ROWCOUNT With the FORALL Statement

But I know that at each iteration just one row is deleted. How can I know the TOTAL rows deleted, not the ones at each iteration? Can I use SQL%ROWCOUNT in this case?

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2015
Added on Dec 13 2014
7 comments
2,490 views