Home » SQL & PL/SQL » SQL & PL/SQL » Linking table fields in oracle
Linking table fields in oracle [message #18542] Tue, 05 February 2002 01:30 Go to next message
Messages: 5
Registered: August 2001
Junior Member
I HAVE 2 TABLES one called
developers and skills

here the fields
f_name skills_sets
l_name skill_id

using this command to link the tables

ALTER TABLE developers ADD (CONSTRAINT qs_sessions
FOREIGN KEY (name_id)
REFERENCES skills (name_id))

I recieved the following error

The following error has occurred:

ORA-02270: no matching unique or primary key for this column-list

what am I doing wrong is my design wrong.
Re: Linking table fields in oracle [message #18544 is a reply to message #18542] Tue, 05 February 2002 02:19 Go to previous message
Messages: 417
Registered: September 1998
Senior Member
The reference, in your case skills.name_id, has to be the primary key or have a unique constraint.
(Are you sure you want to refere from the developer table to the skills and not from the skill to the developper table?)

Previous Topic: query
Next Topic: Mutating Error & constraining Error
Goto Forum:

Current Time: Sat Sep 25 18:28:11 CDT 2021