Subject | Re: [firebird-support] FK's and NULL |
---|---|
Author | Helen Borrie |
Post date | 2004-10-26T23:07:41Z |
At 08:09 AM 27/10/2004 +1000, you wrote:
key ("dependent rows") will have their foreign key column(s) set to null.
can't apply the ON DELETE SET NULL. or ON UPDATE SET NULL action to a
foreign key that includes any NOT NULL columns.
Even if there is a parent key that is NULL (which is allowed on one row in
the parent table if the referenced key is a UNIQUE constraint), the nulled
child rows still have no parent, since (NULL==NULL) can never be true.
./heLen
>Hi,When the "parent" row is deleted, any rows referring to it via the foreign
>
>This is a question for Helen, as I have been reading her Book, and I am not
>sure I understand the following statement:
>
>"...the foreign key corresponding to the old parent PK is set to null
key ("dependent rows") will have their foreign key column(s) set to null.
> - the dependent rows become orphans.Orphan = a "dependent" row that has no parent key.
>Clearly, this action trigger can not be applied if the foreign key columnA non-nullable column is one that is constrained to be NOT NULL. So, you
>is non-nullable..." page 302
can't apply the ON DELETE SET NULL. or ON UPDATE SET NULL action to a
foreign key that includes any NOT NULL columns.
Even if there is a parent key that is NULL (which is allowed on one row in
the parent table if the referenced key is a UNIQUE constraint), the nulled
child rows still have no parent, since (NULL==NULL) can never be true.
./heLen