Two Foreign keys
862018May 19 2011 — edited May 19 2011Hi, 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? ?