Subject | Re: On Delete Cascade |
---|---|
Author | Sandor Szollosi <ssani@freemail.hu> |
Post date | 2003-02-13T13:55:16Z |
Hi,
table doesn't contain the master record.
Let assume us the delete order would run vica versa (step1: delete
from detail, step2: from master).
For example 1000 record in detail belong to the record in master.
If another FK points to record in master(in 2 detail table),
disabling to delete it, this error will shown after deleting the 1000
detail record.
Regards,
Sandor
> Ok, I see that BeforeDelete/AfterDelete are triggered in detailBy my experiencies works this way.
> table when I do a delete on master table, and the FK action is On
> Delete Cascade. And that when I do an update in the master PK
> field, if On Update Cascade action is used, the corresponding field
> in detail table will be update accordingly.
>
> But, when I do a delete to the master table, it seems that the
> master record is deleted, and after that, the correspondig detail
> records will be deleted, in that order. Is that true?
> My problem was that in detail AfterDelete trigger, I was trying toget a
> value from a join involving the master table. And I was alwaysgetting a
> null value. I've concluded that master record was deleted beforethe detail.
>updated
> I was expecting a behavior similar to an update, when the master is
> and after that the detail is updated.To my mind when the detail Before/AfterDelete trigger run, the master
>
> The delete shouldn't behave like the update?
table doesn't contain the master record.
Let assume us the delete order would run vica versa (step1: delete
from detail, step2: from master).
For example 1000 record in detail belong to the record in master.
If another FK points to record in master(in 2 detail table),
disabling to delete it, this error will shown after deleting the 1000
detail record.
Regards,
Sandor