Oracleを扱い始めました。
MySQLのINSERT INTO ... ON DUPLICATE KEY UPDATE ...文をOracleでやるにはMERGE文を使う。
MySQL [sql] INSERT INTO hoge (unique_key, key1, key2) VALUES (:UK, :K1, :K2) ON DUPLICATE KEY UPDATE key1 = :K1, key2 = :K2; [/sql]
Oracle [sql] MERGE INTO hoge USING DUAL ON (unique_key = :UK) WHEN MATCHED THEN UPDATE SET key1 = :K1, key2 = :K2 WHEN NOT MATCHED THEN INSERT (unique_key, key1, key2) VALUES (:UK, :K1, :K2); [/sql]