Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Very strange... PK enabled with null values in it!
In which versions do you have this behavior?
I try in 7.3.4 and it works correctly:
v734> create table t (col1 number, col2 number); v734> insert into t values (1,1); v734> insert into t values (2,null); v734> alter table t add primary key (col1, col2); alter table t add primary key (col1, col2) *
--
Regards
Michel
Erwin Dondorp <erwindon_at_wxs.nl> a écrit dans le message :
384E9C85.76EFE125_at_wxs.nl...
> aquabubble wrote:
> > I was wondering if anyone else had seen this kind of thing before. This
> > should be impossible, so how can I have a primary key enabled with null
> > values in its column?
> >
> > Also, we've just seen another table with a composite primary key with
> > null values in its second column.
> >
> > In both of these cases, the pk is enabled and the index is valid
> > (whatever use that info is).
>
> In some versions of Oracle this effect can/could be reached by adding
> the primary
> key after the record were already present.
> ALTER TABLE ... ADD PRIMARY KEY
> did check for duplicate records during the index building but the NOT
> NULL constraint
> that was also added was never checked.
>
> --
> Erwin Dondorp
> <http://www.dondorp.com/>
Received on Thu Dec 09 1999 - 02:53:08 CST
![]() |
![]() |