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
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
How to define a sub function?
How many anonymous blocks can be defined?
How to run the anonymous block again?
What is a synonym? What are its various types?
What is an oracle database?
What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
What is an oracle database table?
How to use "out" parameter properly?
Explain the difference between sql and oracle?
Explain integrity constraints?
How does Oracle guarantee data integrity of data changes?
How to shutdown your 10g xe server?
How to retrieve values from data fields in record variables?
Can objects of the same schema reside in different tablespace?