Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: turning off triggers or allowing a trigger to determine to run or exit?

Re: turning off triggers or allowing a trigger to determine to run or exit?

From: <kasperle_at_cs.tu-berlin.de>
Date: 1997/08/21
Message-ID: <33FC2CD5.2F55@cs.tu-berlin.de>#1/1

Joachim Carlsson wrote:
>
> Jerry F. Davis wrote:
> >
> > I am *not* a Database person, but I am submitting a question for one who is in
> > our company.
> >
> > We have a little problem. We have a product that we have developed that has
> > something in it called an audit trail. The database person says it is all
> > implemented via triggers.
> >
> > What we want to do is to offer this audit trail feature as an option.
> >
> > Current thinking is to have two identical databases with one using the
> > triggers for audit trail and one without.
> >
> > This seems a waste to me. Is there a way we can set a variable somewhere in
> > the database that we could then look at during an audit trail trigger event
> > that we could simply exit the trigger if the audit trail flag variable is not
> > set?
> >
> > Our database people don't think so. They say Oracle won't allow them to read
> > a variable from a table during a trigger event - or something to that effect.
> >
> > I hope I have stated the case properly for them!!!
> > Has anyone ever done this?
> >
> > Thank you.
> >
> > Regards,
> > Jerry
>
> Hmm I'm not with you all the way but it's possible to read a variable and
> from a database during a trigger event. There are howerver restricted
> functions that can not be run from certain triggers, because they can
> start calling them self in an endless loop.

Hi!

It can be done by a variable stored somewhere in a table. An other solution would be, writing a script that disables or enables the triggers. I would prefer the latter, because of performance. You don't have to start a trigger just to find out, that it shouldn't have started.

But the main question is: Do you really want this? Both solutions end up in delivering a complete DB. If your customer is clever enough, he can turn the option on without having paid for it.

regards,
Kathrin Spiller Received on Thu Aug 21 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US