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



I assume you don't really think that FETCH is skipping records, not
that there couldn't be a bug in IBM's code, but assuming you are
current on PTFs, it's unlikely.

That being the case, you need to give us more code. In particular,
I'd like to know what the values are for W_Field and W_Value; along
with the definition of the field whose name is in W_Field.

Cut out as much code as you can, but we need to see the SQL and the
writes to the display file.

Charles

On Fri, Oct 3, 2008 at 10:02 AM, Donna Fabianke
<Donna.Fabianke@xxxxxxxxxxxx> wrote:


I am creating a cursor on a file and then doing a fetch next to load a
subfile.
The problem I am having is that the fetch seems to be skipping records.
I ran this in debug and for example I have more than 1 record for a
particular invoice. So, if invoice 1 with a date of 1/09/08 for both
records, the fetch gets the first record but then it goes onto the next
date (which is in the order by clause) - the date is rpdivj and the
invoice number is rpdoc.
I appreciate any advice!

C Eval W_Sql='Select * From F0311 where ' +
C W_Field + '=' + W_Value +
C ' Order by RPDIVJ, RPDOC'
C/Exec SQL
C+ Prepare @S1 from :W_Sql
C/End-Exec
C/Exec SQL
C+ Declare CsrF0311 Cursor For @S1
C/End-Exec
C/Exec SQL Open CsrF0311 USING :W_Field, :W_Value
C/End-Exec


Fetch statements:
C/Exec SQl
C+ Fetch From CsrF0311
C+ Into :DS0311
C/End-Exec

Thanks,

Donna Fabianke
McLane Company
Sr. Programmer/Analyst
254-771-7094
Donna.Fabianke@xxxxxxxxxxxx <mailto:Donna.Fabianke@xxxxxxxxxxxx>


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.