Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi how Can I Add A Foreign key that references a table that
has composit primary key ?
example i had costumer table that has C_Id and SSN Both as
PK and another table has C_Id that must refernece C_Id in
Customers i done the usual way and got oracle error message
about uniqeness any ideas plz

Answer Posted / manish yadav

Problem:I think you are challenging the concept of foriegn
key here, a forign key should be unique or primary key in
the refrenced table,C_ID in your case is part of composite
key i.e. its not primary key itself and nither unique key.

Solution:In customer table you may not want to change
primary key but if possible add unique constraint on C_ID
column. It should work

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is oracle a relational database?

870


What is the difference between postgresql and oracle?

977


What is the meaning of recursive hints in oracle?

992


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

2209


What is a user account in oracle?

1064


Name the various constraints used in oracle?

969


What is SQL access advisor in Oracle?

1136


What is the difference between formal parameters and actual parameters?

1001


What is the use of oracle?

981


In what script is snap$ created? In what script is the scott/tiger schema created?

2654


Why cursor variables are easier to use than cursors?

1019


What is rich query?

926


can anyody please send me the dump for Oracle 10g certifications for DBA path?

2087


How to do a full database export?

1043


What is an oracle user account?

929