Subject | Re: [ib-support] Fw: Problem creating foreign key |
---|---|
Author | Graham Reeves |
Post date | 2002-01-17T11:48:31Z |
Thanks for the reply Helen
I made the description the primary key and it worked.
The problem is that I actually have more fields in the SkyStatus table.
Therefore the primary key consists of three fields, Description being one of
them. When I try and create the child table it still gives me the same
error.
Is there a work around??
TIA
Graham
I made the description the primary key and it worked.
The problem is that I actually have more fields in the SkyStatus table.
Therefore the primary key consists of three fields, Description being one of
them. When I try and create the child table it still gives me the same
error.
Is there a work around??
TIA
Graham
----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <ib-support@...>
Sent: Thursday, January 17, 2002 11:53 AM
Subject: Re: [ib-support] Fw: Problem creating foreign key
> At 10:10 AM 17-01-02 +0200, you wrote:
> >Okay,
> >
> >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.
>
> 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.
>
> regards,
> Helen
>
> All for Open and Open for All
> Firebird Open SQL Database ยท http://firebirdsql.org
> _______________________________________________________
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>