Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is this supposed to work like this?
Alan.
Validation of foreign keys is performed only if none of the fields in the
key contains NULL.
Joe Rogers wrote:
> Alan Caldera wrote:
> ...
> > CREATE TABLE tablea (a1 number, a2 number, a3 number);
> > ALTER TABLE tablea ADD PRIMARY KEY (a1, a2);
> > INSERT INTO tablea VALUES(1,2,3);
> > INSERT INTO tablea VALUES(4,5,6);
> > COMMIT;
> >
> > CREATE TABLE tableb (aa1 number, aa2 number, aa3 number);
> > ALTER TABLE tableb ADD PRIMARY KEY (aa1);
> > ALTER TABLE tableb ADD FOREIGN KEY (aa2, aa3);
> > INSERT INTO tableb VALUES(1,1,null);
> > COMMIT;
> >
> > Why do I not get a FK violation on the insert into table B? If I put
> > ...
-- ==================================================== Oren Nakdimon Golden Screens Ltd. address: 17 Abba-Hillel st., Ramat-Gan 52522, ISRAEL email: oren_at_gsit.co.il tel: +972-3-7510836 fax: +972-3-7518221 ====================================================Received on Thu Oct 30 1997 - 00:00:00 CST
![]() |
![]() |