Toad World® Forums

Trigger References


#1

Ok, this is a weird one …

I have two tables …

“Table”

and “TableAudit”

In “Table”, I have a trigger … “tri_table_audit”. This trigger fires on every INSERT and DELETE statement on “table”. It then, inserts a copy of the new data into the audit table. BTW: Both “table” and “tableAudit” contain the same fields.

Now, when I go an generate the DDL SQL script. It will first create the “table”, then the triggers, then “tableAudit”. The problem with this order is, the trigger is created with compilation errors, since tableAudit does not exist at that time.

Is there any way to have triggers created after it’s dependencies are created? Or am I doing this all wrong?


#2

Hello Shannara,

Well, we hope to understand well.

Please see Model menu | Order of Generated Objects and change order of the tables as you need - TableAudit and then Table.

Hope this tip helps.

In case of any questions, please write me back. Thanks.

Regards,

Vladka


#3

That is awesome! Thanks for the help :slight_smile: