Using IGNORE_DUP_KEY in an Oracle Database (sqlplus)

I try to run the following code on less than 10,000 lines, but I get

ORA-00001: unique constraint (constraint_name) violated (not unexpected).

UPDATE table1
   SET EMAILADRESSE = replace(EMAILADRESSE,'@domain1.no','@domain2.no')
 WHERE EMAILADRESSE LIKE '%@domain1.no' ;

I tried IGNORE_DUP_KEY, but this is not supported in oracle / SQL * PLUS, as my research shows. Do you have alternatives for me?

+4
source share
2 answers

Another with NOT EXISTS!

UPDATE table1 t1
   SET EMAILADRESSE = replace(EMAILADRESSE,'@domain1.no','@domain2.no')
 WHERE EMAILADRESSE LIKE '%@domain1.no' 
 AND NOT EXISTS
 (SELECT 'X' FROM table1 t2 WHERE t2.EMAILADRESSE = replace(t1.EMAILADRESSE,'@domain1.no','@domain2.no'));
+1
source

-, , . EMAILADRESSE . 1, , .

  UPDATE table1
    SET EMAILADRESSE = replace(EMAILADRESSE,'@domain1.no','@domain2.no')
    WHERE EMAILADRESSE LIKE '%@domain1.no' AND   replace(EMAILADRESSE,'@domain1.no','@domain2.no') NOT IN (SELECT EMAILADRESSE FROM table1)
0

All Articles