Reputation: 133
In the PL/SQL Script I want to capture the number of rows affected with a particular statement, something like
BEGIN
del_count := { DELETE FROM <SOME_TABLE>}
END
How to achieve this ?
Upvotes: 1
Views: 53
Reputation: 21851
Use SQL%ROWCOUNT;
BEGIN
DELETE FROM EMPLOYEES
WHERE MANAGER = 10;
dbms_output.put_line(SQL%ROWCOUNT || ' rows were deleted');
END;
Upvotes: 2