I need to be able to run an Oracle query which goes to insert a number of rows, but it also checks to see if a primary key exists and if it does, then it skips that insert.
If you do NOT want to merge in from an other table, but rather insert new data... I came up with this. Is there perhaps a better way to do this?
MERGE INTO TABLE1 a USING DUAL ON (a.C1_pk= 6) WHEN NOT MATCHED THEN INSERT(C1_pk, C2,C3,C4) VALUES (6, 1,0,1);