Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Two Foreign keys

862018May 19 2011 — edited May 19 2011
Hi, I wish to create a table with two foreign with the same name.

I have a first table named "*Registry* " with a column named "*id_registry*" as PK, and a second table named "friends" with two columns "*id_res*" and "*id_friends*". Now I'd like that id_res and id_friends should be the FK and have the same PK id_registry as references.
I tried this way:
ALTER TABLE friends add COSTRAINT friends:FK FOREIGN KEY (id_res, id_friends) REFERENCES anagrafica (id_registry); but I got an error like this: ORA-02256.

Is possible to do that? ?
This post has been answered by Ganesh Srivatsav on May 19 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2011
Added on May 19 2011
2 comments
178 views