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

ur a sql devoloper...what is the process in ur company for finding the database BUGS .. seperate DB testers are there? or devr.s are manage? if DB TESTERS in there what is the process

2263


How to define a sub function?

1127


How many anonymous blocks can be defined?

1179


How to run the anonymous block again?

1126


What is a synonym? What are its various types?

1106


What is an oracle database?

1033


What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?

2127


What is an oracle database table?

1011


How to use "out" parameter properly?

1079


Explain the difference between sql and oracle?

1074


Explain integrity constraints?

1102


How does Oracle guarantee data integrity of data changes?

2382


How to shutdown your 10g xe server?

1145


How to retrieve values from data fields in record variables?

1109


Can objects of the same schema reside in different tablespace?

1060