ORA-00001: unique constraint (MYDB.SYS_C006557) violated

From: jose soares <jose.soares_at_sferacarta.com>
Date: Thu, 29 Mar 2012 16:39:46 +0200
Message-ID: <4F747432.9050706_at_sferacarta.com>



Hi all,

I think I have a problem with NULL values on composit indexes:

create table test(id int primary key, pia int, ua int, data date, ver int); create unique index unik on test(pia int, ua , data , ver ) insert into test values (1,37,76,null,1); insert into test values (2,37,76,null,1);

ORA-00001: unique constraint (MYDB.SYS_C006557) violated

I hope Oracle knows that no two null values are equal :-)


this one works, instead:

create table test(id int primary key, pia int, ua int, data date, ver int); create unique index unik on test(data )
insert into test values (1,37,76,null,1); insert into test values (2,37,76,null,1);

what's wrong?

j

--

http://www.freelists.org/webpage/oracle-l Received on Thu Mar 29 2012 - 09:39:46 CDT

Original text of this message