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!

New to Orcale

459355Oct 10 2005 — edited Oct 12 2005
Hi Everyone,

I am new to oracle and I have a small problem and was stucked for days.

I am creating 2 tables each has a foreign key referencing the other table. However, whenever I try to create the first table, sql plus complaint that the other table did not exist and refused to create the table.

create table EMPLOYEE (
......
SSN varchar(10) not null;
.....
foreign key (DNO) references DEPARTMENT(DNUMBER)
);

ERROR at line 13:
ORA-00942: table or view does not exist

create table DEPARTMENT (
......
DNO varchar(5) not null;
......
foreign key(MGRSSN) references EMPLOYEE(SSN)
);


Would any one give me a hint ?


Thanks in advance!


Alex
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 9 2005
Added on Oct 10 2005
23 comments
1,006 views