Subject Re: [ib-support] Re: On Delete Cascade
Author Martin D. Berezaga
> > SIn a Foreign Key defined with On Cascade Delete action, when I do
>a Delete
> > in Master table, the BeforeDelete/AfterDelete Detail triggers will
>be fired?
>
>Yes they will work.
>
> >
> > And if I do an Update for a On Cascade Update Action?
>
>I don't understand this question. Please, write it again other way.
>
>
>Sandor

Sandor, thanks for answering.

Ok, I see that BeforeDelete/AfterDelete are triggered in detail 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 to get a
value from a join involving the master table. And I was always getting a
null value. I've concluded that master record was deleted before the detail.

I was expecting a behavior similar to an update, when the master is updated
and after that the detail is updated.

The delete shouldn't behave like the update?

Thanks.

---------------------------
Martin D. Berezaga
mdberezaga@...
ICQ : 18537142
Porto Alegre - RS - Brasil
---------------------------