Oracle Alternative for MySQL REPLACE INTO

In MySQL we use

REPLACE INTO 

to insert if the row does not exist and is updated if it exists.

Does Oracle have a corresponding team?

+6
source share
2 answers
 MERGE INTO destTable d USING ( SELECT * FROM sourceTable ) s ON (s.id = d.id) WHEN NOT MATCHED THEN INSERT (id, destCol1, destCol2) VALUES (id, sourceCol1, sourceCol2) WHEN MATCHED THEN UPDATE SET destCol1 = sourceCol1, destCol2 = sourceCol2 
+7
source

In Oracle you are looking for something like Merge

Use

  Merge Into myTable s USING Select x from y; 

See documentation

0
source

All Articles