Triggers
Hi all:
I am trying to achieve the following:
1. There are 2 tables TABLE1 and TABLE2. Each has a delete trigger on its own. TABLE2 is a child table of TABLE1.
2. When I delete a record in TABLE1, the TABLE1 delete trigger is fired, which will delete records in TABLE2, firing its delete trigger.
3. The point is: from within the delete trigger of TABLE2 I want to access the DELETED table of TABLE1.
There are other processes that delete records from TABLE2 without deleting a record in TABLE1, so that has to be considered. (Cascading Referential integrity through foreign key constraints will not work here because the trigger does a lot of things)
The solution I am thinking of is using a temp table to store the DELETED table for TABLE1 so that the delete trigger for TABLE2 can read it; I am looking for a better solution than this.
TIA,
Bernard Omiple
|