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 Caldera wrote:
>
> I came across a condition today that did'nt make sense to me.
> Consider the following problem:
>
> 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
> in an obviously invalid combination in aa2 and aa3 then I get the
> appropriate parent key not found message.
>
> Any ideas?
>
> Thanks.
>
> Alan Caldera
> acaldera_at_airmail.REMOVETHISSPAMBLOCKER.net
I don't know if you intended it to do it this way but I guess as you mention above , you forgot to make any reference to tablea ....
Does this answer your question ??
Ciao !
-- ================================================================ ============================ | Joseph Sumalbag | | Oracle DBA | | | | The opinions expressed above are my own and doesn't necessarily | |reflect the opinion of any of my client company or my employer. | ================================================================ ============================Received on Wed Oct 29 1997 - 00:00:00 CST
![]() |
![]() |