Home » RDBMS Server » Server Administration » Related primary/foreign keys
Related primary/foreign keys [message #372198] Thu, 18 January 2001 12:08 Go to next message
Syed Afroz Alam
Messages: 2
Registered: January 2001
Junior Member
A master table have composite primary key on two or three columns. Can we make a detail table which refer(foreign key) to one of the composite primary key columns of master table.
Re: Related primary/foreign keys [message #372201 is a reply to message #372198] Thu, 18 January 2001 13:00 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
No, It is not possible..
but what you can do is create unique key on one column in composite primary key of master table, then you can make that column as reference column of detail table.

HTH
Suresh
Re: Related primary/foreign keys [message #372202 is a reply to message #372198] Thu, 18 January 2001 13:01 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
As far as I know - NO. Sounds like what you need is a higher level table which your 2 or 3 field PK refers to. Then this other table you mention should reference the new higher level table.

An FK by definition means that each row in the child table is tied to a particular row in the parent table. The way to uniquely identify a row in the parent table is it's PK. I think you can also reference a unique constraint (alternate key - not a PK) but this won't help.
Previous Topic: format the output of dbms_output
Next Topic: Oracle Test Case
Goto Forum:
  


Current Time: Fri May 17 23:31:56 CDT 2024