Subject | Re: [ib-support] Can't insert foreign key constraint |
---|---|
Author | Helen Borrie |
Post date | 2001-10-07T14:29:28Z |
At 03:53 PM 07-10-01 +0200, Carsten Schaefer wrote:
Has IBConsole by any chance created case-sensitive identifiers in your database? Does it work to add the constraint using the same case as was used for creating the table, i.e. F_ID_CHARGE.
rgds,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>Hi,Carsten,
>i have a table:
>create table T_CH_APOS_ZUORD (
> F_ID_CHARGE INTEGER NOT NULL,
> F_ID_APOS INTEGER NOT NULL
>);
>ALTER TABLE T_CH_APOS_ZUORD
> ADD PRIMARY KEY
> (F_ID_CHARGE,F_ID_APOS);
>
>Now i want to add a foreign key constraint to it (t_charge has id_charge as primary key):
>ALTER TABLE T_CH_APOS_ZUORD
> ADD CONSTRAINT FK_CH_APOS_ZUORD_ID_CHARGE FOREIGN KEY
> (f_id_charge)
> REFERENCES T_CHARGE
> (ID_CHARGE)
> ON UPDATE NO ACTION
> ON DELETE CASCADE;
>
>I get the following error from ibconsole:
>
>Unsuccessful metadata update
>STORE RDB$REF_CONSTRAINTS failed
>action cancelled by trigger (1) to preserve data integrity
>Name of Referential Constraint not defined in constraints table
>Statement: ALTER TABLE T_CH_APOS_ZUORD
> ADD CONSTRAINT FK_CH_APOS_ZUORD_ID_CHARGE FOREIGN KEY
> (f_id_charge) <--------------------------------
> REFERENCES T_CHARGE
> (ID_CHARGE)
> ON UPDATE NO ACTION
> ON DELETE CASCADE
>
Has IBConsole by any chance created case-sensitive identifiers in your database? Does it work to add the constraint using the same case as was used for creating the table, i.e. F_ID_CHARGE.
rgds,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________