Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: FK and NULL values
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)27885841Received on Tue Dec 17 1996 - 00:00:00 CST
![]() |
![]() |