Subject | How can I distinguish "explicit deleting" by "cascade deleting" ? |
---|---|
Author | ricfio |
Post date | 2009-01-27T15:01:19Z |
Hi, I have two table "TAB_H" and "TAB_R".
Table TAB_R have a trigger "TAB_R_AD0" on after delete.
Deleting a record from "TAB_H" cause a cascade deleting on "TAB_R".
On the trigger TAB_R_AD0 I would distinguish the two record deleting
from TAB_R:
a) Explicit deleting (By User)
DELETE FROM TAB_R WHERE ...
b) Cascade deleting (By Engine)
DELETE FROM TAB_H WHERE PK_TAB_H="X"
=>
DELETE FROM TAB_R WHERE FK_TAB_H="X"
N.B.
I cannot use MON$ tables for this because I have more DELETE FROM
TAB_R (see above A) in the same transaction.
Thanks in advance.
Riccardo
Table TAB_R have a trigger "TAB_R_AD0" on after delete.
Deleting a record from "TAB_H" cause a cascade deleting on "TAB_R".
On the trigger TAB_R_AD0 I would distinguish the two record deleting
from TAB_R:
a) Explicit deleting (By User)
DELETE FROM TAB_R WHERE ...
b) Cascade deleting (By Engine)
DELETE FROM TAB_H WHERE PK_TAB_H="X"
=>
DELETE FROM TAB_R WHERE FK_TAB_H="X"
N.B.
I cannot use MON$ tables for this because I have more DELETE FROM
TAB_R (see above A) in the same transaction.
Thanks in advance.
Riccardo