CREATE OR REPLACE PROCEDURE trnct_table (i_table_name IN VARCHAR2)
IS
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || i_table_name;
DBMS_OUTPUT.put_line (
'Table ' || i_table_name || ' truncated successfully.');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Truncate table failed.');
END;
SET SERVEROUTPUT ON;
BEGIN
trnct_table ('emp');
END;
/
No comments:
Post a Comment