Subject Re: [firebird-support] FK creation problem
Author Helen Borrie
At 05:16 PM 14/01/2004 +0100, you wrote:
>Hi,
>
>why does this statement fail:
>
>alter table T_BENUTZER
>add constraint FK_T_BENUTZER
>foreign key (AKTUELLE_PA)
>references T_PROVISIONSABRECHNUNGEN(ID)
>
>
>violation of FOREIGN KEY constraint "".
>violation of FOREIGN KEY constraint "PK_T_PROVISIONSABRECHNUNGEN" on table
>"T_PROVISIONSABRECHNUNGEN".
>
>ID an Aktuelle_PA are both NUMERIC(18,0).
>
>This is the DDL of the constraint that is mentioned in the above text:
>
>ALTER TABLE T_PROVISIONSABRECHNUNGEN ADD CONSTRAINT
>PK_T_PROVISIONSABRECHNUNGEN PRIMARY KEY (ID);
>
>I am using Firebird 1.03.

It looks as though you have some non-null values in AKTUELLE_PA that are
not present in the ID column of T_PROVISIONSABRECHNUNGEN.

/hb