× 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.



All,
I have been doing this for years, but now for some reason, my multi row
fetch is only returning 1 row even though I requested up to 300 rows.
running the exact same SQL using QMQRY, I get 4 rows returned.

My code is as follows:
<snip>
Exec SQL
Fetch Item_Data for :Records_to_Read Rows
Into :Item_Details;
If SqlState < *Zero;
Leave;
EndIf;

Exec SQL
Get Diagnostics
:Last_Row = DB2_Last_Row,
:Records_Read = Row_Count;
Where Item_Data is the cursor the I defined, Records_to_Read is 300 and
Item_Details is a MODS defined with Occurs(300).

My actual SQL is about 100 lines, and when I copy and paste it into a
separate source member (without the Declare Cursor) and use it the create a
QMQRY object, I get 4 rows returned, so I know my SQL is correct.

System is at V7R1M0
SF99710 CUMULATIVE PTF PACKAGE C4143710
SF99709 GROUP HIPER
SF99708 GROUP SECURITY
SF99707 TECHNOLOGY REFRESH
SF99701 DB2 FOR IBM I

Any idea why this is happening?

Jeff Young
Sr. Programmer Analyst

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.