Home » SQL & PL/SQL » SQL & PL/SQL » foreign key?
foreign key? [message #218057] Tue, 06 February 2007 10:43 Go to next message
stevenson
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
MarcL
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
JRowbottom
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: Wed Dec 07 16:35:21 CST 2016

Total time taken to generate the page: 0.08244 seconds