Subject | violation of foreign key constraint |
---|---|
Author | Duilio Foschi |
Post date | 2002-03-22T20:06:06Z |
I use Firebird (v. WI-T1.0.0.679).
I tried to add the following constraint to table ART:
ALTER TABLE ART ADD CONSTRAINT ART_INVALIDCOD_ACC FOREIGN KEY (COD_ACC)
REFERENCES TB_ACC (COD_ACC)
This is the error message I get:
"violation of foreign key constraint INTEG_73 on table tb_acc"
I am puzzled: INTEG_73 is the primary key of TB_ACC, defined as
Primary key (COD_ACC)
Accordingly, I have only distinct values of COD_ACC in TB_ACC.
I do have replicated values of COD_ACC in ART, but this should be natural.
Why is Firebird complaining ?
TIA
Duilio Foschi
I tried to add the following constraint to table ART:
ALTER TABLE ART ADD CONSTRAINT ART_INVALIDCOD_ACC FOREIGN KEY (COD_ACC)
REFERENCES TB_ACC (COD_ACC)
This is the error message I get:
"violation of foreign key constraint INTEG_73 on table tb_acc"
I am puzzled: INTEG_73 is the primary key of TB_ACC, defined as
Primary key (COD_ACC)
Accordingly, I have only distinct values of COD_ACC in TB_ACC.
I do have replicated values of COD_ACC in ART, but this should be natural.
Why is Firebird complaining ?
TIA
Duilio Foschi