I have a merge statement in a stored procedure doing insertion in Termination table.
During the process i am getting unique key contraint violation and the control is coming out. Unique constraint is there on Termination_name column.
I want the process to be continued inserting other records skipping the duplicate records which it is trying to insert.
MERGE INTO TERMINATIONS TGT
USING (SELECT *
FROM TMP_STG_TRFM_TERMINATIONS) SRC
ON (TGT.TERMINATION_ID = SRC.TERMINATION_ID)
WHEN NOT MATCHED
THEN
INSERT VALUES (SRC.TERMINATION_ID,
SRC.UPDATE_DATE,
SRC.TERMINATION_NAME,
SRC.TERMINATION_TYPE_ID,
SRC.EQUIPMENT_ID,
SRC.INVENTORY_ID)