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!

Roll back or commit based on deleted rows count

730915Sep 29 2010 — edited Sep 29 2010
Hi,

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.
This post has been answered by hm on Sep 29 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2010
Added on Sep 29 2010
7 comments
1,536 views