Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

execute create trigger script in a procedure

LudockOct 22 2008 — edited Oct 22 2008
Is it possible to create a trigger with pl/sql?

I have made a procedure thats makes the create or replace trigger statement.
(when i copy and past the statement the trigger is created succesvol)

How can i execute the create trigger statement on the end of the procedure?


Thanks.

Comments

388131
First of all I would reconsider if you really need to create a trigger inside a procedure. Question the reason...
Then, if you really need to do create it that way, you could try dynamic sql.
Ludock
This trigger have to be on all tables.

After creation a table, i call the procedure to generate the trigger.
388131
Well, then proceed with dynamic SQL.

Or, in my opinion much better: produce a SQL script with variables for table name and trigger name.
Then run this script with the appropriate values every time you have created a table.

Cheers,
Guido

Edited by: Guido on Oct 22, 2008 10:30 AM
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 19 2008
Added on Oct 22 2008
3 comments
357 views