Why or why not to use triggers
Posted in 1996
Is there any good reason to avoid triggers? (e.g. performance hits?) I have seen triggers abused to death in previous software (undocumented spaghetti logic which will most likely produce unintended results), but with care, it seems like there is nothing wrong with using triggers to insure that certain state-transitions are logged (referential integrity enforced, change users and times are recorded etc...) The reason I am asking is I recently moved to a new company which doesn't use them at all. I have been in previous positions in which triggers were avoided due to the (now obsolete) reason that early versions of Informix didn't support them...When triggers were supported by Informix, the reasoning was that the code would not be as portable to Oracle or Sybase (as if Informix's "ANSI" sql resembles either of those other "ANSI" sql anyway). So the only valid reason I can think of for avoiding triggers is possibly performance (which doesn't seem like that big of a deal when you're mostly writing 4GL anyway....whoever came up with 4GL obviously didn't give a damn about performance) Thanks for any advice. - Danny Wright #include <StdDisclaimers.h>