3 Replies Latest reply on Aug 9, 2013 9:45 PM by ChrisJenkins-Oracle

    Update fails with 'Unique constraint violated' error


      Hi all,


      I don't understand the following:


      Command> create table test (ID TT_BIGINT PRIMARY KEY, EMAIL VARCHAR(128), MSISDN


      Command> create unique index MSISDN__UNIQUE on test (MSISDN ASC);

      Command> create unique index EMAIL__UNIQUE on test (EMAIL ASC);

      Command> insert into test values (1, 'deps@d.d', '2222222');

      1 row inserted.

      Command> update test set EMAIL='deps@d.d' where ID=1;

        907: Unique constraint (EMAIL__UNIQUE) violated at Rowid <BMUFVUAAAA1AQAACDg>

      The command failed.


      Why do I have the unique constraint violation here? I'm changing the EMAIL value to the same value!


      Thanks in advance,