View previous topic :: View next topic
|
Author |
Message |
Elixir
Active User
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 |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you figure showing us the select, from and where clauses of your cursor declaration,
and what populated the host variables used in the where clause
are of no use to us? |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
I think it is more likely that there is a problem with your PERFORM UNTIL COBOL coding. |
|
Back to top |
|
|
|