15 pts.
 Trap SQLCODE from RUNSQLSTM
I have a RUNSQLSTM that updates a table. When it hits a duplicate, it quits and returns SQL9010. What I want it to do is just skip the step that got a duplicate and move on. Is there a way to do this?

Software/Hardware used:
Iseries
ASKED: February 6, 2013  9:13 PM
UPDATED: February 7, 2013  1:33 PM

Answer Wiki:
Use an EXCEPTION JOIN to only insert/update those records that do not already exist in the table.
Last Wiki Answer Submitted:  February 7, 2013  1:33 pm  by  Michael Tidmarsh   11,410 pts.
All Answer Wiki Contributors:  Michael Tidmarsh   11,410 pts. , CharlieBrowne   32,915 pts. , khalon   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Is this a set of updates? Or is it a single update each time you run RUNSQLSTM? — Tom

 108,280 pts.