Execute Immediate: Help

Execute Immediate: Help

 

  

Hi All

begin
execute immediate('CREATE TRIGGER IBEW_LOG_FIRST_NAME_INS BEFORE INSERT
ON CUSTOMER for each row declare begin NULL; END;');
end;
/

PL/SQL procedure successfully completed.

But if I create a procedure and execute that procedure it giving the error. Like

1 create or replace procedure test as
2 begin
3 execute immediate('CREATE TRIGGER IBEW_LOG_FIRST_NAME_INS BEFORE INSERT
4 ON CUSTOMER for each row declare begin NULL; END;');
5* end;
6 /

Procedure created.

SQL> exec test
BEGIN test; END;

*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "IBEW50.TEST", line 3
ORA-06512: at line 1

I did not find the remedy. Please help.

Thanks

navin

Oracle LazyDBA home page