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: ORA-00001 on non-unique index!

Re: ORA-00001 on non-unique index!

From: <gromanescu_at_gmail.com>
Date: 7 Nov 2006 09:08:18 -0800
Message-ID: <1162919298.082513.45200@h48g2000cwc.googlegroups.com>

> 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

Original text of this message

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