Foreign Key constraint help!
From: Dan Hield <dan.hield_at_cwcom.net>
Date: Fri, 18 Dec 1998 16:10:04 -0000
Message-ID: <367a7e14.0_at_news1.mcmail.com>
Using Oracle7, I am trying to create a foreign key on a table which has a composite key of three referencing another table which has a composite key of two.
Date: Fri, 18 Dec 1998 16:10:04 -0000
Message-ID: <367a7e14.0_at_news1.mcmail.com>
Using Oracle7, I am trying to create a foreign key on a table which has a composite key of three referencing another table which has a composite key of two.
i.e.
table1
name Null? Type col1 not null varchar2(8) col2 not null varchar2(50) col3 varchar2(3) col4 number(3) col5 varchar2(2000) table2 name Null? Type col1 not null varchar2(8) col2 not null varchar2(50) col3 not null varchar2(50)
I get this error message: 'ORA-02294: cannot add referential constraint - paretn keys not found.'
The script I am using to attemp to create the foreign key is as follows:
ALTER TABLE2 ADD CONSTRAINT fk1
FOREIGN KEY (col1, col2) REFERENCES TABLE1(col1, col2);
Any help greatly appreciated. Keen to learn fast!
Dan. Received on Fri Dec 18 1998 - 17:10:04 CET