开始
SET serveroutput ON;DECLAREp_tab_name varchar2(20);cursor_name INTEGER;p_rows_del INTEGER; BEGINp_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);EXCEPTIONWHEN OTHERS THENDBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM,1,100)); END;
结束