I am trying to write a stored procedure that inserts a record into a table.
If that record is already stored in that table, i just want to update it.
However, I don't want to test whether that record exists before I do the
insert (the reason being that 99% of the records will not exist in the db at
that time). In the case where the record exists, I want to trap the error
message that is raised and handle it internally within the stored procedure
and I don't want to return an error to the calling process.
If I were to do this in an informix database i would have done something
On Exception In (<error message for 'record exists'>)
Set Status = 4
Where orderid = 1;
Insert Into Orders (1,2,3,4)
Thanks for your help.