| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Primary -- foreign keys
"Pavol Obecajcik" <Pavol.Obecajcik_at_onatix.com> wrote in message
news:f19254f5.0108101207.6c3e4535_at_posting.google.com...
> prk25_at_yahoo.com (keith) wrote in message
news:<adbca63f.0108100550.b176fc5_at_posting.google.com>...
...
> > create table abc
> > (
> > x integer primary key,
> > y char(20),
> > foreign key (x) references abc(x)
> > );
> >
> > What's being accomplished by creating a forein key which references a
> > primary key of the same table??? Primary and foreign keys are on the
> > same column of the same table????
> >
> > Thanks
> >
> > Keith
> >
>
>> 2. NOT NULL restriction => impossible to insert first row in table
> 1. Foreign key must hold only existing values from referenced column
> (eventually NULL) => violated unique restriction.
>
Hi,
I also thought it was nonsense :-) and came theoretically to the same conclusion that you can't insert the first row. Then I tried it with personal Oracle and I was ABLE to insert some rows. So I suppose Oracle is right and we're are wrong. :-(
can someone explain the meaning of this?
Yariv Received on Fri Aug 10 2001 - 18:40:15 CDT
![]() |
![]() |