• 0

[Oracle] Primary / foreign key question


Question

For Oracle am I right in thinking the table which has the primary key must contain all the fields which are in the foreign keys table?

Example: if I try and add a foreign key to a table which does not contain all the fields the primary key's table has I get an error:

ERROR at line 2: ORA-02298: cannot validate (OPS$mystudentnumber.FK_COURSECODE_CHECK) - parent keys not found

After Google'ing I came across this which basically says add the fields from the other table that are missing.

Edit – never mind, after removing data from the tables I dont appear to have that problem anymore! Beginners mistake I guess ;)

Edited by InsaneNutter
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.