Subject | Re: [firebird-support] Nullable foreign keys |
---|---|
Author | Christian Gütter |
Post date | 2004-04-29T08:30:25Z |
Hi Helen,
thanks for your quick response.
I think I did not make myself perfectly clear - I think "nullable" was
not the correct word for what I mean.
I would like to have a foreign key field that can be NULL - and when
it is NULL, no RI should take place.
But when the value is different then NULL, RI should take place and
deletes and updates should *not* be possible - i. e.
ON UPDATE NO ACTION and ON DELETE NO ACTION.
But a foreign key field defined like that does not accept NULLs.
This is my problem ;-)
Christian
thanks for your quick response.
> Sure you can. You can even have an RI actionI know about ON DELETE SET NULL.
> ON DELETE SET NULL
> to return the dependent row to a "pool of orphans" when the master row gets
> deleted.
I think I did not make myself perfectly clear - I think "nullable" was
not the correct word for what I mean.
I would like to have a foreign key field that can be NULL - and when
it is NULL, no RI should take place.
But when the value is different then NULL, RI should take place and
deletes and updates should *not* be possible - i. e.
ON UPDATE NO ACTION and ON DELETE NO ACTION.
But a foreign key field defined like that does not accept NULLs.
This is my problem ;-)
Christian