Problem Statement:- I am inserting a record into Oracle if that record is already present(duplicate==>primary key is present) in database i want to update it with new one.
Currently to solve this while inserting the record if i get OCI_ERROR then i call
OCIErrorGet( (dvoid *)errhp, (ub4) 1, (text *) NULL, &errcode,errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
Then i check errbuf if the value of the errror buf is ORA-00001 ==> unique constraint violated if it is present then i update the value
Is there way to do the same thing except searching for record in the database if that record is already present update it I do not want to do this because i will have to write a code for that
Is there any specific error generated if the value is duplicated in ORACLE?
any suggestions?