Trigger Refresh

Here is an interesting problem. We generated our original data model in Power Designer and imported into TDM via DDL. In the DDL were triggers (before update, before delete, and before insert) that were generated by Power Designer. The problem is we have since made changes to our tables, but those changes were not reflected in the triggers associated with the tables (i.e. fields that are no longer in the table still are referenced in the trigger).

I guess I’m wondering if Toad is supposed to update those triggers, or if we should just delete them.

Any assistance would be appreciated. Thanks!

Hi,

where did you change the tables? In Toad Data Modeler model, in PowerDesigner or in physically existing database?

A) Toad Data Modeler - you have to maually change the specification of triggers when you do a change in tables (used in your triggers)

B) You can generate new DDL script, then load it into Toad Data Modeler and do model compare/model merge.

C) You can reverse engineer your database and then do model compare/model merge.

Regards,

Vaclav

The changes were made in Toad after we imported from the DDL.

I’m wondering if we even need these triggers if we have all of the fields in the relationship designated as a foreign key. I think Power Designer generated the triggers to keep referential integrity.

Does anyone have any thoughts on that?

Hi,

referential integrity can be achieved via triggers or declaratively. If you are OK with the second option the you might not need the triggers.

Howerer, I don’t know your model, db structure, triggers specification etc. and that’s why I wrote “might not need” instead or “will not need” :slight_smile:

Regards,

Vaclav