Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-00001 on non-unique index!
> I pick out the new records I want using the predicate 'datecol is null
> and numcol = 5'.
How about a composite index on datecol and numcol?
> fails with the following error:
>
> ORA-00001: unique constraint (IX2) violated
>
> IX2 is a non-unique FBI so how Oracle can generate a unique constraint
> violation on it is a mystery to me. Can anyone help?
>
gabe_at_XE> create table g (id number);
Table created.
gabe_at_XE> create index ix2 on g(id);
Index created.
gabe_at_XE> alter table g add constraint ix2 primary key (id);
Table altered.
gabe_at_XE> insert into g values (1);
1 row created.
gabe_at_XE> insert into g values (1);
insert into g values (1)
*
ERROR at line 1:
ORA-00001: unique constraint (GABE.IX2) violated
"IX2" is the name of the constraint ... happens to be the name of a non-unique index too. Received on Tue Nov 07 2006 - 11:08:18 CST