Subject Re: [firebird-support] Nullable foreign keys
Author Helen Borrie
At 11:05 AM 29/04/2004 +0200, you wrote:
>Hi Martijn,
>
> > Sure it does. If you define it as NULLable :-)
>
> > eg:
>
> > PERSON
> > --
> > Name
> > Last_Name
> > CarID
>
> > Where "car" is a FK to table CARS. CarID should be nullable.
>
> > CARS
> > --
> > CarID
> > Name
> > Brand
> > etc...
>
> > (obviously, this design is... well, sub-optimal, but it works)
>
>for me it is not only sub-optimal, but also unsatisfying, because
>all of my FKs are linked to the PKs of other tables which must never
>be NULL.
>
>Any other idea how I can do this?

What I do is have a "master" key of zero, which I assign the foreign key
when I want to "park" the dependent rows somewhere.

/heLen