Ignoring duplicates in multi-rows INSERT
509382May 2 2006 — edited May 3 2006Hi,
I am migrating a C++ client using MySQL C API in Oracle using OTL/OCI9i.
My problem is the following:
In MySQL is possible to run an SQL statement to insert records to specifically ask to ignore duplicates on unique keys (e.g. PRIMARY KEY).
MySQL Example:
CREATE TABLE test_tab (i1 int, i2 int, i3 int, PRIMARY KEY(i1,i2));
INSERT IGNORE INTO test_tab VALUES (1,1,1), (2,2,2), (3,3,3), (1,1,1);
The effect in MySQL is that only the first 3 records are inserted and the fourth is skipped and no errors reported by the Server to the client application.
I would like to know if there is a similar way to do this in Oracle in order to avoid to get in my client application the Oracle error: "ORA-00001: Unique constraint ... violated" stopping my application.
Thanks.