Thread: Can foreign keyed field allow nulls?

Can foreign keyed field allow nulls?

From
lbottorff@harveycounty.com
Date:
I have a table with a field I'd like to do a REFERENCES to a lookup table on;
however, this field is not manditory, i.e., can be NULL. Is it possible to do
such a thing?

LB



Re: Can foreign keyed field allow nulls?

From
Stephan Szabo
Date:
On Mon, 5 Mar 2001 lbottorff@harveycounty.com wrote:

> I have a table with a field I'd like to do a REFERENCES to a lookup table on;
> however, this field is not manditory, i.e., can be NULL. Is it possible to do
> such a thing?

Maybe.  If the key is a single column, it should be fine.  If it's a
multi-column key then it depends on what match type you are using.  For
MATCH FULL, all the columns must be null or none of the columns may be
null.  For the unspecified match type you can have a null in the key but
such a key will always succeed.