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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is this supposed to work like this?

Re: Is this supposed to work like this?

From: Oren Nakdimon <oren_at_gsit.co.il>
Date: 1997/10/30
Message-ID: <34583D1D.6B44A6D9@gsit.co.il>#1/1

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

Original text of this message

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