Обсуждение: Can foreign keyed field allow nulls?

Поиск
Список
Период
Сортировка

Can foreign keyed field allow nulls?

От
lbottorff@harveycounty.com
Дата:
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?

От
Stephan Szabo
Дата:
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.