Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: FK and NULL values

Re: FK and NULL values

From: Lun Wing San (Oracle) <wslun_at_qrcsun.qrc.org>
Date: 1996/12/17
Message-ID: <32B6C40B.76F8@qrcsun.qrc.org>#1/1

Peter Aku wrote:
> FK1 is a foreign key defined on table B. FK1 is composed
> of more than one column.
>
> If NULLs are allowed on those columns (FK1) in table B,
> when a row which contains NULLs on any of the columns that
> compose FK1, ORACLE allows these NULLs to be inserted,
> as expected. However, no validation is performed on the
> foreign key constraint. Inconsistent values may be
> introduced through this kind of addition or update
> exercise.
>

  Oracle practices match none. As a result, if one of the columns in the composite foreign key is null, it can insert into the child table. As a result, you can restricts not null column constraint on each column of the foreign key or add a check table constraint to check your null situation.

---
Name   : Lun Wing San
Title  : Oracle Application Developer of Hong Kong Productivity Council
         Oracle Database Administrator and System Administrator of QRC
Phone  : (852)27885841
Received on Tue Dec 17 1996 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US