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
How a tablespace is related to data files?
How to call a stored function with parameters?
What is rich query?
What is the simplest tool to run commands on oracle servers?
What is SQL Tuning Advisor in Oracle?
How to view existing locks on the database?
How to load data through external tables?
What privilege is needed for a user to query tables in another schema?
How to compare dates in oracle sql?
What are the different types of database objects?
how the indexes are stored in the Oracle Database?
What is hot backup and logical backup?
Can we store pictures in the database and if so, how it can be done?
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??
What is SQL access advisor in Oracle?