×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Mike,

no, I'm not clearing, but looking at the data structure, it's clearly
fetching 13 records - it's the first fetch of the program and the
entire data structure is filled.

The records in the data structure are exactly what I expect them to be
- but SQLER3 only says I fetched 7, when clearly I fetched 13 rows.

If I were fetching one row at a time, I would use SQLCOD instead, but
when fetching multiple rows, I've always found SQLER3 to be reliable -
if less than the number of rows requested, i'm at eof.   even if I
used SQLCOD instead, I would need to know how many rows I fetched (if
less than 13) were fetched on the last fetch.

Really, the more I look at this, the more I feel it must be a bug.

Rick

On 3/31/06, Michael_Schutte@xxxxxxxxxxxx <Michael_Schutte@xxxxxxxxxxxx> wrote:
> We've always used SQLCOD for our conditioning.  If < 0 or = 100, then no
> more records were fetched.
>
> Anyway,  Are you clearing all the INTO fields before fetching them.  The
> fetch will not clear those fields if records were not fetched.
>
> Michael Schutte
> Work 614-492-7419
> email  michael_schutte@xxxxxxxxxxxx
>
>
>
>             "rick baird"
>             <rick.baird@gmail
>             .com>                                                      To
>             Sent by:                  "RPG programming on the AS400 /
>             rpg400-l-bounces@         iSeries" <rpg400-l@xxxxxxxxxxxx>
>             midrange.com                                               cc
>
>                                                                   Subject
>             03/31/2006 04:46          SQL fetch multiple records and
>             PM                        SQLER3
>
>
>             Please respond to
>              RPG programming
>              on the AS400 /
>                  iSeries
>             <rpg400-l@midrang
>                  e.com>
>
>
>
>
>
>
> Hey all,
>
> I'm doing an SQLRPGLE select - left outer join on two files and
> fetching 13 records at a time to fill a subfile page.
>
> the join has the possibility to have left side records without right
> side records, and I'm taking that into account ( - alwnull(*usrctl)
> and checking the null indicators of records fetched ).
>
> my problem is that I need to know how many records I fetched so I know
> when i'm at EOF.
>
> I've always used SQLER3 to tell me this, but it's not working now.
>
> The first fetch I do, my data structure has 13 records in it, and they
> are the records I expected to get, but SQLER3 has 7 in it.
>
> coincidently, record 8 is the first record with nulls in the right
> side file fields.
>
> what gives?  It fetched 13 records, but SQLER3 tells me only 7 were
> fetched.
>
> Any help would be appreciated.
>
> Rick
>
> --
> 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.
>
>
>
> --
> 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.
>
>


This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.