A program creates a Datacom SQL cursor and does a FETCH.
It does a DELETE for certain rows and then it does an INSERT outside of the cursor to re-add the row with modified values.
The next FETCH reads the record just inserted.
The program expects to read the next record in the cursor not the one just inserted.
The behavior of the cursor when inserting rows can be controlled by using the DECLARE CURSOR SENSITIVE / INSENSITIVE option.
In this case use option:
DECLARE CURSOR ... SENSITIVE STATIC SCROLL
This will not read the row inserted outside the cursor when doing a FETCH.
See documentation section DECLARE CURSOR Statement.