Dynamic Triggers [message #373232] |
Thu, 05 April 2001 12:45 |
Trigger Happy
Messages: 1 Registered: April 2001
|
Junior Member |
|
|
Trying to create triggers dynamically with a function. I build a string from metadata from the database starting with "create trigger on table_name..." and so forth. At the end of the function, I need a way to execute the script to create the trigger. Nothing seems to work, not DBMS_sql.execute() or anything in the PLV/Vision third party packages (if anyone is familiar with those). Is there another way? What should I do?
|
|
|
Re: Dynamic Triggers [message #373233 is a reply to message #373232] |
Thu, 05 April 2001 13:03 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
An easy way is to generate a script in SQL...
Spool insert_trigger_templates.sql
select 'create or replace trigger '||table_name||'_ins'||chr(10)||
' as ...'
from user_tables;
spool off;
|
|
|