× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 8/29/2023 9:59 AM, Greg Wilburn wrote:
I have a program that loops through fetching various groups of records... This is within a statement that was called 3 times with different cursors.

The first time through, 4 rows were retrieved.
Second time, 1 row.
Third time, 1 row.

When this ran today, iteration 2 and 3 contained the new row AND the 3 rows leftover from the first iteration.

My question is, do I need to explicitly "clear" the data structure before the SQL Fetch?

Not exactly, but it won't hurt.

I understand that you tried it and got no results; perhaps posting that code will clear this up. Lord knows I myself have put a CLEAR one line too far down...

What I myself do for multi-row FETCHes is to handle undesired SQLSTATEs, and then only use as many rows as got actually returned by checking SQLER3.

https://www.ibm.com/docs/en/i/7.4?topic=area-field-descriptions


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.