Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
The issue is in regard to a CURSOR WITH HOLD declared in a Batch Cobol-DB2 program
For the defined CURSOR WITH HOLD, at the time of Program execution there are 3 rows. But this CURSOR fetches the row for 4 Times; the 1st row is fetched twice.
I have thoroughly checked the Program Logic in Expeditor, nothing is wrong with the Program flow. I am not sure why the First row is being fetched Twice.
Also After opening the Cursor & before 1st fetch I defined a Count(*) using the where Clause of the CURSOR WITH HOLD, the count is 3.
I decided to go ahead with INSENSITIVE SCROLL CURSOR WITH HOLD. The issue of 1st row being fetched twice is eliminated.
I went throught the documentation of the INSENSITIVE SCROLL CURSOR, but still I am not able to understand how the issue of multiple fetch for the same row was eliminated by the use of this.
Please guide me in getting more clarity on this issue.
Please let me know if I missed out on any important information for looking into the issue