|Subject||RE: [firebird-support] FK's and NULL|
> Of course. Foreign keys by nature are never meant to beI have created a scrip based on what I am trying to run. This script is
> unique, except when enforcing a 1:1 relationship.
> >As I am getting no errors from FB when I do this, as well as
> having unique
> >constraints for the FK fields. I have also defined
> FK_Constraints so that on
> >delete and update the result is cascade.
> Well, that's one action rule, whereas ON DELETE | UPDATE SET
> NULL is a
> (mutually exclusive) other. If you are using the CASCADE
> rules, then the
> SET NULL rules don't apply, obviously...
generating the same error.
I would really appreciate if you could point out the possible errors in
CREATE DOMAIN D_NON_NULL AS
CHECK (VALUE IS NOT NULL AND VALUE > 0);
CREATE DOMAIN D_NULL AS
CHECK (VALUE IS NULL OR VALUE > 0);
CREATE TABLE CWMONITORS
CW_VW_ID D_NULL ,
CONSTRAINT PK_CWMONITORS PRIMARY KEY (CW_ID)
CREATE TABLE VWMONITORS
VW_ID D_NON_NULL ,
CONSTRAINT PK_VWMONITORS PRIMARY KEY (VW_ID)
ALTER TABLE CWMONITORS ADD CONSTRAINT U_CWMONITORS UNIQUE
ALTER TABLE CWMONITORS ADD CONSTRAINT FK_CWMONITORS
FOREIGN KEY (CW_VW_ID) REFERENCES VWMONITORS
ON DELETE CASCADE
ON UPDATE CASCADE;
Before I forget, the error is:
ISC ERROR CODE:335544351
ISC ERROR MESSAGE:
unsuccessful metadata update
object VWMONITORS is in use
Comvision Pty. Ltd.