NULLs in columns referencing foreign keys
Posted in 1997
Topics: Triggers, Constraints & Referential Integrity
Someone in the office has got me thinking about the use of NULLs in columns that reference other tables. In the schema, we have a table containing a column which references a second table (Say a table with Individuals, where each may have a reference into a table of addresses). However, some individuals don't have addresses, so we store a NULL in the referencing column. The debate started because the comparison between the referencing column and the referenced table's keys will return UNKNOWN when the referencing column is NULL. I'm being told that the effect of this depends on which version of Online you're running - some behave like our current 7.2 and don't match, but this guy says that others will match. This seems pretty fundamental to me. What's the scoop? Thanks Dave -- _________________________________________________________________________ | Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~