I have one program in production which is doing join operation on 2 tables using primary key of tab A and forgien key of Tab B based on some condition in where clause. Also i am using "optimize for 1 row " option in where clause.
When program updates tab B based on key field which is already fetch from select clause, some time program runs fine and ended with mcc 00 but some day it abend (User abend) with following error.
DSNT404I SQLCODE 100, NOT FOUND, ROW NOT FOUND FOR FETCH , UPDATE
program runs fine again after some time without any user intervention.
what i found by searching in net is this prob occurs due to heavy usage of DB at instance so if you reset the DB to it's initial state program will run fine on next run onwards.
Can any one give me more inputs in this?????????????
My understanding of the problem is this
*) There is a select clause and after this there is an update. The update fails after the fetch.
The problem might be that the record fetched is not locked. Try using Fetch "For Update" clause in the Select sql. This will hold the record in Update lock. Also try using the Isolation as CS. Try releasing the lock by a commit after the update as you have stated that there is a heavy DB usage...