Subject Re: [firebird-support] Re: Null Foreign Keys
Author Martijn Tonies

> > > As you can see, I have inserted NULL in FK column. Does that answer
> > > the question?
> >
> > Yes--I had a bit more complex situation and could not get it to work.
> > Thanks for your time.
> Did your problem involve FKs which were also part of a PK or unique
> index?
> If so, then all FB v1.0 and IB versions did not allow NULLs in the
> key/index.
> FB v1.5 allows you to define a PK/Unique index with NULLs.

Please make a difference between an unique INDEX and an unique
CONSTRAINT. Unique indices don't let you allow to create a FK
pointing to them, while constraints do.

As far as I can remember, IB and Fb1 did allow one NULL into an
unique INDEX, but not in a constraint. I might be wrong there though.

There's no such things as a PK index - there is a PK constraint :-)
As far as I know, you won't get any NULLs inside a PK constraint.

With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions