Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Triggers 1

Status
Not open for further replies.

asb555

Programmer
Dec 19, 2000
37
US
Hi All,

I am using an Oracle Trigger on one of my tables. It works fine except that if I make any changes to the table (ex: add a field), the trigger gets invalidated(i.e. doesn't work). I have to drop the trigger and then recreate it for it to start working. Any ideas on to what's going on?

Thanks in Advance.
Amir
 
Instead of recreating trigger use
ALTER TRIGGER <trigger> COMPILE
 
Also, the invalid trigger(s) will be automatically recompiled the first time there is an attempt to execute it/them, so you don't really need to do anything unless:

1) You want to make sure that the change you made to the table doesn't now cause the trigger to fail to compile (for instance, you dropped a column that the trigger uses).

2) You want to eliminate the performance hit that recompiling the trigger will cause during that execution attept.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top