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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / mrs.priya
try to separate the composite key using str function when
referencing in another function to get only C_ID
| Is This Answer Correct ? | 0 Yes | 0 No |
How to apply filtering criteria at group level in oracle?
List out the types of joins.
Write query to fetch second maximum salary from employee table.
4 Answers Bravura Solutions, HCL,
select * from emp what happened internally when we write this query in the sql prompt?
Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?
waht is referencial integrity?
How to convert csv to table in oracle?
Hello All, Could any one provide me FAQs/interview questions on oracle PL/SQL
How does oracle handle read consistency?
What SQL query from v$session can you run to show how many sessions are logged in as a particular user account?
how to get the no employee in each department including the dept which has 0 employee
What is the recommended interval at which to run statspack snapshots, and why?