Re: How to solve trigger side effects



On 6 jul, 13:53, thalio...@xxxxxxxxxxxx wrote:
Hello there,

I've got 2 triggers. Each trigger belongs to a certain table.

Now I've got following problem. One trigger does something which leads
to execution of the other trigger. The reason is, that the one trigger
changes data in that table having the other trigger. Now I want to
deactivate the second trigger, if it was triggered by the first
trigger. Is there a way to find out, who is the causer of a trigger.

Or is there a way to find out, whether a certain table is just now
updated? So I can deactivate the second trigger, if just now data are
updated in the first table.

Does anyone have an advice for me?

Thanks in advance,
Norbert

One idea would be the first trigger would set a variable in a package,
and the other trigger would read that variable.
If the variable has a specific value then don't proceed.
The package consists of a local variable, a function to get the
contents, and a procedure to set it.

--
Sybrand Bakker
Senior Oracle DBA

.



Relevant Pages

  • How to solve trigger side effects
    ... Each trigger belongs to a certain table. ... changes data in that table having the other trigger. ... So I can deactivate the second trigger, ...
    (comp.databases.oracle.misc)
  • Re: => Unorthodox DB Updates - Trigger order
    ... But if you have any suggestions for trigger ordering it ... The last trigger is fired on each update of SupplierOrder. ... collectionMovementID into the SupplierOrder rows in the second trigger ... a second statement if it is really necessary. ...
    (microsoft.public.sqlserver.mseq)
  • Re: Global Variables?
    ... Why have a second trigger do this? ... first trigger and pass the needed info into it? ... into a second trigger I've ...
    (microsoft.public.sqlserver.programming)
  • Re: system trigger question
    ... so it isn't recognised as a completed PL/SQL trigger. ... selects in system triggers so the original code for the second trigger ... compiles error-free. ...
    (comp.databases.oracle.server)