Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002

    Red face Unanswered: Synchronization of triggers

    I have a table A with columns (t1,t2 and t3)
    and a table B with columns (b1,b2 and b3).

    I have a update trigger on table A which updates new values into t1,t2 and t3 whenever new values are inserted into b1, b2 and b3 in table B.
    and I also have a triggger on table B which does a reverse update i.e....
    when ever new values are updated into t1,t2,t3 new values are inserted
    into b1,b2,b3 in table B.

    Each of this update triggers work fine individually.

    But will not work when both trigggers are enabled.

    How do I synchronize them.

  2. #2
    Join Date
    May 2002
    1. Insert a record in A.
    2. Trigger in A will insert a record in B.
    Trigger(Before Insert) in B should check that
    if record with new.b1, new.b2, new.b3 values already exists in B
    do not insert the record in B
    Insert the record in B.
    END if;
    Similarly write the trigger in A.

    Santosh Sarkar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts