I need to create a trigger inside a pl/sql block. When I do it inside an anonymous block, it works perfect, the trigger is created and all. If I name the procedure and try to compile it, it says "Insufficient Privileges" at times or "Table or View does not exist". Has anyone faced this kind of problem ?
The query is as below, comment the create portion for the trigger to be created and comment the declare portion to see the error.
create or replace procedure create_tr as
hand integer := dbms_sql.open_cursor;
v_string := 'create or replace trigger wsbenadmin.test_tr '||
' before insert on wsbenadmin.tbl_master for each row '||
'begin Null; end;';