Home » SQL & PL/SQL » SQL & PL/SQL » Question of foreign key
Question of foreign key [message #47] Tue, 08 January 2002 03:28 Go to next message
oranew
Messages: 6
Registered: January 2002
Junior Member
There are two demo tables in Oracle: EMP and DEPT in schema SCOTT. There is a foreign key DEPTNO in table EMP. I tried this SQL statement: 'insert into emp(empno) values(8888);' which is successful.
How can this row be inserted into EMP since the value in column DEPTNO is null? why this didn't voliate the foreign key constraint?
Re: Question of foreign key [message #50 is a reply to message #47] Tue, 08 January 2002 04:16 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
null values allowed.. if you dont null values to be inserted specify not null on deptno in emp table.
Previous Topic: foreign key and primary key
Next Topic: Question re Installation / Possible Conflicts
Goto Forum:
  


Current Time: Thu Mar 28 16:12:38 CDT 2024