Subject | Re: [ib-support] Fw: Problem creating foreign key |
---|---|
Author | Helen Borrie |
Post date | 2002-01-17T09:53:33Z |
At 10:10 AM 17-01-02 +0200, you wrote:
regards,
Helen
All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________
>Okay,This seems to be a "catch-all" error for all foreign key errors. In this case you are getting it because the foreign key column is being referenced to a column which isn't the primary key.
>
>I've done a bit of research regarding my problem listed below. Apparently it is a known bug that was found in IB 4.2. I have IB 6 and I'm still confused as to why this problem is still occurring.
>
>Any help would be appreciated
>
>TIA
>Graham
>
>----- Original Message -----
>From: Graham Reeves
>To: Ib-Support@...
>Sent: Wednesday, January 16, 2002 2:09 PM
>Subject: Re: Problem creating foreign key
>
>
>Hello all
>
>I have two tables that have a one-to-many relationship. in the child table I am trying to create a foreign key referencing the parent. When I execute the DDL the it gives me the following error...
>
>"This operation is not defined for system tables.
> 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."
>
>Obviously there is something that wrong, but I'm not exactly sure :-(
>
>Below are the table definitions...
>
>CREATE TABLE SKYSTATUS
>(
> STATUSCODE VARCHAR(5) NOT NULL,
> DESCRIPTION VARCHAR(100) NOT NULL,
>
> PRIMARY KEY (STATUSCODE)
>);
>
>Create Unique Index xSkyStatusDescription on SkyStatus(Description)
>
>CREATE TABLE SKYCLIENTDIARY
>(
> ACCNO VARCHAR(20) NOT NULL,
> DATEOFENTRY TIMESTAMP NOT NULL,
> TIMEOFENTRY VARCHAR(20) NOT NULL,
> CUSER VARCHAR(30),
> CDATE TIMESTAMP,
> CTIME VARCHAR(20),
> ENTRYTYPE VARCHAR(100) NOT NULL,
>
> PRIMARY KEY (ACCNO, DATEOFENTRY, TIMEOFENTRY),
> FOREIGN KEY (EntryType) REFERENCES SkyStatus (Description)
> ON UPDATE CASCADE
> ON DELETE CASCADE
>);
>
>If anyone has any ideas I would appreciate it.
regards,
Helen
All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________