Linking with Foreign Keys

Posted on 16th Feb 2014 by admin

I have been getting an erro when I try and link:

create table Faculty_Specialty (I_Name varchar2(20) not null, Specialty varchar2(40) not null);

using :

alter table faculty_specialty modify (foreign key (I_Name) references faculty);

to:

Create table Faculty (I_Name varchar2(20) primary key);

The following error occurs:

SQL> alter table faculty_specialty modify (foreign key (I_Name) references faculty (I_Name));
alter table faculty_specialty modify (foreign key (I_Name) references faculty (I_Name))
*
ERROR at line 1:
ORA-02298: cannot validate (ORDB029.SYS_C0027281) - parent keys not found

I Know it's elementry but I can figure out why this is happening.....

Other forums