Subject | Re: [ib-support] Implementing referential integrity |
---|---|
Author | Stevio |
Post date | 2002-07-03T18:07:20Z |
Hi,
The code posted in the email at the bottom of this email doesn't work to
create a foreign key.
I receive the error:
Unsuccessful metadata update
could not find UNIQUE INDEX with specified columns
Statement: CREATE TABLE RELATEDSUBJECT (
RELATED_SUBJECT_ID INTEGER NOT NULL,
DEWEY_NO_ID INTEGER NOT NULL CONSTRAINT FK_DEWEY REFERENCES DEWEYNO(ID),
RELATED_DEWEY_NO_ID INTEGER NOT NULL,
PRIMARY KEY (RELATED_SUBJECT_ID)
)
Any ideas?
Thanks,
Stephen
The code posted in the email at the bottom of this email doesn't work to
create a foreign key.
I receive the error:
Unsuccessful metadata update
could not find UNIQUE INDEX with specified columns
Statement: CREATE TABLE RELATEDSUBJECT (
RELATED_SUBJECT_ID INTEGER NOT NULL,
DEWEY_NO_ID INTEGER NOT NULL CONSTRAINT FK_DEWEY REFERENCES DEWEYNO(ID),
RELATED_DEWEY_NO_ID INTEGER NOT NULL,
PRIMARY KEY (RELATED_SUBJECT_ID)
)
Any ideas?
Thanks,
Stephen
----- Original Message -----
From: "Arno Brinkman" <firebird@...>
Sent: Friday, June 28, 2002 1:17 PM
> --------------------
> CREATE TABLE CUSTOMER
> (
> ID INTEGER NOT NULL CONSTRAINT PK_CUSTOMER PRIMARY KEY,
> FULLNAME VARCHAR(35)
> );
>
> CREATE TABLE INVOICE
> (
> ID INTEGER NOT NULL CONSTRAINT PK_INVOICE PRIMARY KEY,
> CUSTOMER_ID INTEGER CONSTRAINT FK_INVOICE_CUSTOMER REFERENCES
> CUSTOMER(ID),
> CALCTOTAL NUMERIC(12,3),
> DESCRIPTION VARCHAR(50)
> );