标签:
CREATE OR REPLACE PROCEDURE BATCH_DELETE
(
P_TABLENAME IN VARCHAR2,
P_CONDITION IN VARCHAR2,
P_RESULT OUT NUMBER
)
AS
BEGIN
EXECUTE IMMEDIATE
‘DELETE FROM ‘ || P_TABLENAME || ‘ WHERE ‘ || P_CONDITION ;
IF SQL%NOTFOUND THEN
P_RESULT :=0;
--EXIT;
ELSE
P_RESULT :=SQL%ROWCOUNT;
END IF;
COMMIT;
DBMS_OUTPUT.PUT_LINE(‘FINISHED!‘);
DBMS_OUTPUT.PUT_LINE(‘TOTALLY ‘||TO_CHAR(P_RESULT)||‘ RECORDS DELETED!‘);
END;
标签:
原文地址:http://www.cnblogs.com/iyoume2008/p/4700444.html