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

How a tablespace is related to data files?

1109


How to call a stored function with parameters?

1046


What is rich query?

983


What is the simplest tool to run commands on oracle servers?

1009


What is SQL Tuning Advisor in Oracle?

1181


How to view existing locks on the database?

1053


How to load data through external tables?

1136


What privilege is needed for a user to query tables in another schema?

973


How to compare dates in oracle sql?

1104


What are the different types of database objects?

1062


how the indexes are stored in the Oracle Database?

2271


What is hot backup and logical backup?

1051


Can we store pictures in the database and if so, how it can be done?

1045


There are n numbers of flatfile of exactly same format are placed in a folder.Can we load these flatfile's data one by one to a single relational table by a single session??

2027


What is SQL access advisor in Oracle?

1191