Subject RE: [firebird-support] Compound foreign key & null value bug?
Author Rick Debay
> I'd have to say that for foreign key relationships a null in the referencing field is considered to match

How about in the referenced field? BTW, thanks for the quick reply.

From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Ann Harrison
Sent: Thursday, October 25, 2012 10:33 AM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Compound foreign key & null value bug?

 
Rick,

> I forgot to populate the new column in the child table, so all the
> relationships looked like this:
>
> Child Parent
> ----- ------
> Col1:null -> Col1:A
> Col2:B -> Col2:B
>
> The new foreign keys were created without any errors. Since (null,B)
> doesn't match anything, shouldn't the creation have failed?
>

Since you want a quick answer, I believe that behavior follows the
standard. I have it in front of me, but digging out the expected null
behavior is a pain, but from the fact that one of the acceptable behaviors
of a cascading update or delete is to set the matching field(s) in the
child table to null, I'd have to say that for foreign key relationships a
null in the referencing field is considered to match.

Good luck,

Ann

[Non-text portions of this message have been removed]