I have a table named TABLE1 having 2 columns (NO, NAME)
CREATE TABLE TABLE1( NO NUMBER(3) NOT NULL, NAME VARCHAR2(5) NOT NULL);
CREATE UNIQUE INDEX TX ON TABLE1(NO,NAME);
I am trying to insert values as mentioned below:
INSERT INTO TABLE1 VALUES(101, 'JOHN');
INSERT INTO TABLE1 VALUES(102, 'MORN');
INSERT INTO TABLE1 VALUES(103, 'TONY');
INSERT INTO TABLE1 VALUES(103, 'TONY');
INSERT INTO TABLE1 VALUES(103, 'RONY');
As you see above, I have given one insert statement twice. Actually, above insert statements are working fine but when it comes 4th insert statement, it is throwing error which is expected. I am looking for INSERT INTO VALUES statement if duplicate insert statement comes it should skip that particular insert statement without showing error and go for next INSERT statement.
I tried using the below statements but its not working in Oracle SQL
INSERT IGNORE INTO TABLE1 VALUES(101, 'JOHN');
INSERT IGNORE INTO TABLE1 VALUES(102, 'MORN');
INSERT IGNORE INTO TABLE1 VALUES(103, 'TONY');
INSERT IGNORE INTO TABLE1 VALUES(103, 'TONY');
INSERT IGNORE INTO TABLE1 VALUES(103, 'RONY');