Roll back or commit based on deleted rows count
730915Sep 29 2010 — edited Sep 29 2010Hi,
I have a procedure which deletes the rows from table dummy1. Now the requirement is If the delete query removes more than one row then It has to be rolled back else commit .
Note : column VALUE in the table dummy1 is not a primary column.
CREATE OR REPLACE PROCEDURE P_DELETE_CHECK AS
V_VALUE NUMBER;
V_TABLE_NAME VARCHAR(100);
BEGIN
EXECUTE IMMEDIATE 'DELETE FROM '||V_TABLE_NAME||'WHERE VALUE IN ('||V_VALUE||')';
END P_DELETE_CHECK;
Can anyone help me on this .
Thanks,
Mahesh.