Re: Foreign Key Problem

From: David Sisk <davesisk_at_ipass.net>
Date: 1998/02/22
Message-ID: <6cqr0r$de7$1_at_news.ipass.net>#1/1


[Quoted] If I may interject, FK's must point to a PK or a UK.

Dave

Rachel Carmichael wrote in message <34ED7F3D.93D27478_at_citicorp.com>...
>You will have to build a trigger to do this -- foreign keys by definition
>must be composed of the entire primary key of the table they reference
>
>Rachel
>
>DINFA - Microcentro wrote:
>
>> Hi
>> I have two tables created as follow.
>>
>> Table1 Columns T1Cod1 varchar2(3) NOT NULL Primary Key
>> T1Cod2 varchar2(3) NOT NULL
>> T1Cod3 varchar2(3) NOT NULL
>>
>> Table2 Columns T2Cod1 varchar2(3) NOT NULL Primary Key
>> T2Cod2 varchar2(3) NOT NULL Primary Key
>>
>> T2Cod3 varchar2(3) NOT NULL Primary Key
>>
>> I'd like to create a relationship between two tables as follow
>>
>> ALTER TABLE Table1 CONSTRAINT XPTO_FK
>> FOREIGN KEY (T1Cod2,T1Cod3)
>> REFERENCES Table2 (T2Cod1,T2Cod3)
>>
>> i.e. only the Columns T2Cod1 and T2Cod3 From Table2 are the Key
>> Components of Foreign Key.
>> When i try this an error occurs
>> ORA-02270: No matching unique or Primary Key for this Column List.
>>
>> Is there any way to do that.
>>
>> Thanks in Advence
>> Joe
>
>
>
Received on Sun Feb 22 1998 - 00:00:00 CET

Original text of this message