Home » RDBMS Server » Server Administration » Foreign Key/Primary Key Problem
Foreign Key/Primary Key Problem [message #374061] Wed, 23 May 2001 02:51 Go to next message
Arindam Malakar
Messages: 12
Registered: May 2001
Junior Member
Hi All,

I am Having the following problem:

In Table A I have defined Primary Key(p,q)
p,q=two attributes of the table.

Now,I want to define Table B such that p will be the foreign key.So I have to define the attribute p of Table B by referencing Table A.

But while defining Table B,it is giving the error:
p must be primary key or unique key.

Whether it is possible to do any way.Please help me.Waiting for the earliest reply.

With regards,

Arindam Malakar
Re: Foreign Key/Primary Key Problem [message #374063 is a reply to message #374061] Wed, 23 May 2001 04:11 Go to previous messageGo to next message
Rakesh Goel
Messages: 8
Registered: May 2001
Junior Member
as A.p column still can have more then one value, therefore you cannot set reference on this column in table B till you don't define it as primary key in table A
If you find anyway then please let me know
Re: Foreign Key/Primary Key Problem [message #374064 is a reply to message #374061] Wed, 23 May 2001 04:25 Go to previous messageGo to next message
Sachin Patil
Messages: 7
Registered: May 2001
Junior Member
I didn't get it( your query)
What do you want to say?
Re: Foreign Key/Primary Key Problem [message #374084 is a reply to message #374061] Thu, 24 May 2001 01:36 Go to previous messageGo to next message
vinay_satya
Messages: 1
Registered: May 2001
Junior Member
Hi,

I think it is NOT possible since p and q are the combination PK in table A.
You cannot take p alone for referincing, need to take both p and q from table A to table B .

-Vinay
Re: Foreign Key/Primary Key Problem [message #374915 is a reply to message #374061] Wed, 11 July 2001 14:02 Go to previous messageGo to next message
urooj
Messages: 2
Registered: July 2001
Junior Member
introduction of primary and forigen key
and its relation
Re: Foreign Key/Primary Key Problem [message #374917 is a reply to message #374061] Wed, 11 July 2001 14:28 Go to previous message
urooj
Messages: 2
Registered: July 2001
Junior Member
introduction of primary and forigen key
and its relation
Previous Topic: case insensitivity
Next Topic: Importing french accent data in Oracle
Goto Forum:
  


Current Time: Mon Dec 23 19:31:01 CST 2024