Home » SQL & PL/SQL » SQL & PL/SQL » foreign key?
foreign key? [message #218057] Tue, 06 February 2007 10:43 Go to next message
Messages: 1
Registered: February 2007
Junior Member
why foreign key entries can accept null values?
Re: foreign key? [message #218083 is a reply to message #218057] Tue, 06 February 2007 14:44 Go to previous messageGo to next message
Messages: 455
Registered: November 2006
Location: Connecticut, USA
Senior Member
Why not ?
Re: foreign key? [message #218209 is a reply to message #218083] Wed, 07 February 2007 05:46 Go to previous message
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Because you are allowed optional foreign key constraints.
Ie if there is a value in this column, then it must refer to a PK value in that table over there, but if there is no value in this column, then that's fine.

If you want the FK to be mandatory, just add a Not Null constraint to the column.
Previous Topic: What are PL/SQL tables??
Next Topic: raj_ref_cursor
Goto Forum:

Current Time: Fri Jul 21 05:45:09 CDT 2017

Total time taken to generate the page: 0.19830 seconds