I would like to insert records in SQL such that if the combination of entry exists then the script should not proceed with the insert statement. here is what i have so far :
insert into TABLE_TESTING(R_COMPONENT_ID,OPRID)
select 1942,'Test'
from TABLE_TESTING
where not exists
(select *
from TABLE_TESTING
where R_COMPONENT_ID='1942'
and oprid ='Test');
I have a table name as : TABLE_TESTING It has two columns as : R_COMPONENT_ID and OPRID
If the combination of record as '1942' and 'Test' already exist in DB then my script should not perform insert operation and if it doesent exists then it should insert the record as a combination of R_COMPONENT_ID and OPRID.
Please suggest. Using the query specified above i am getting multiple insert been added in the DB. Please suggest some solution.