Working on Oracle v8i with OS as Win2000.
!Could we use DDL commands in PL/SQL Blocks like in a Procedure as:
EXECUTE IMMEDIATE ALTER TRIGGER TRIG_NAME DISABLE;
EXEC DBMS_SQL PACKAGE.
Could I have the syntax for this and what procedure/function are to be used with the above package.
Thanks & Regards,
Oracle DBA (OCP) v8i,v9i
You've almost got it right yourself:
EXECUTE IMMEDIATE 'ALTER TRIGGER TRIG_NAME DISABLE';
Just remember that EXECUTE IMMEDIATE requires the command to be a string.
This can be put into a stored procedure like:
CREATE OR REPLACE PROCEDURE ddl_command (p_cmd IN VARCHAR2) IS
EXECUTE IMMEDIATE p_cmd;
The procedure owners priviledges will dictate which commands it can perform.
Click Here to Expand Forum to Full Width