Subject Re: [firebird-support] Foreign key violation - but why???
Author Bjoern Reimer
Hi,

>>INSERT INTO XPERT_ZAHLUNGEN
>>(ID,REF_ANMELDUNG_ID,REF_ZAHLUNGSART,ZEITPUNKT) VALUES
>>(30,1,1,'7-MAR-2005 00:00:00');
>>
>>
>> And
>>
>>
>>
UG> At this point, try disconnectiong ALL connections to the Database,
UG> do a fresh connect and than add the following constraint.
UG> Metadata updates like this should only be done if you have ONE
UG> connection to your db.

Yes, I know. I've shut down the server and tried to execute the
statement with the same result!


>>alter table XPERT_ZAHLUNGEN add constraint
>>FK_XPERT_ZAHLUNGEN_REF_ANMELDUN foreign key (REF_ANMELDUNG_ID)
>>references XPERT_ANMELDUNGEN(ANMELDUNG_ID)
>>
>> returns me
>>
>>violation of FOREIGN KEY constraint "".
>>violation of FOREIGN KEY constraint "PK_XPERT_ANMELDUNGEN" on table "XPERT_ANMELDUNGEN".
>>
>>



Björn

--
Björn Reimer -- RRZE
Tel: +49-9131 - 85-27809
Fax: +49-9131 - 302941
Martensstr. 1 / 2.021
D - 9 1 0 5 8 Erlangen
www.rrze.uni-erlangen.de