Home » SQL & PL/SQL » SQL & PL/SQL » Insert Trigger problem after insert action...
Insert Trigger problem after insert action... [message #37104] Thu, 17 January 2002 15:19 Go to next message
buchie
Messages: 5
Registered: March 2001
Junior Member
I have a trigger problem.
There are two tirggers(Atrg, Btrg) and two tables(Atab, Btab).
Atab table has Atrg that inserts into Btab after inserting at Atab.
Btab table has Btrg that inserts into Atab after inserting at Btab.

After insert, Atrg triggers Btrg,
and Btrig triggers Atrig.
and Atrig triggers Btrig...repeatedly.

How could I cut this trigger action ?
Please, let me know...!!
Re: Insert Trigger problem after insert action... [message #37108 is a reply to message #37104] Fri, 18 January 2002 00:05 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
Hi,

Here is the logic for doing the same:

Atrig
-----
1.query the BTAB to find is the record that u want to insert already exist ?
2. if exist then do nothing else insert the record to BTAB.

Btrig
-----
1.query the ATAB to find is the record that u want to insert already exist ?
2. if exist then do nothing else insert the record to ATAB.

Hope it helps!!!

cheers
pratap
Re: Insert Trigger problem after insert action... [message #37169 is a reply to message #37104] Tue, 22 January 2002 00:19 Go to previous messageGo to next message
Milind S Deobhankar
Messages: 33
Registered: January 2002
Member
Use cursors to check wether the record exist , you can use conditional statements within the triggers for the same.
Re: Insert Trigger problem after insert action... [message #39882 is a reply to message #37104] Wed, 21 August 2002 01:18 Go to previous message
Vijaya Krishna
Messages: 1
Registered: August 2002
Junior Member
After insert, Atrg triggers Btrg,
and Btrig triggers Atrig.
and Atrig triggers Btrig...repeatedly.

How could I cut this trigger action ?
Please, let me know...!!

------
Dear Buchie,

If you create the trigger for any action on selected columns except the columns which get updated by vice versa trigger. that would stop the problem
Previous Topic: I want a simpler query!!!
Next Topic: sql/plsql doubts
Goto Forum:
  


Current Time: Fri Apr 19 06:29:40 CDT 2024