开始
SET serveroutput ON; DECLARE p_tab_name varchar2(20); cursor_name INTEGER; p_rows_del INTEGER; BEGIN p_tab_name := 'EMP_CPY'; cursor_name := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cursor_name, 'DELETE FROM '||p_tab_name, DBMS_SQL.NATIVE); DBMS_OUTPUT.PUT_LINE('p_tab_name:'|| p_tab_name); p_rows_del := DBMS_SQL.EXECUTE (cursor_name); DBMS_SQL.CLOSE_CURSOR(cursor_name); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,1,100)); END;
结束
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/11/30/2795634.html,如需转载请自行联系原作者