I know this thread has gone off on a bit of a tangent but I have a
follow up to the original question.

The SQL statement posted to allow the paging works fine when run from
within an SQL session. When I embed it in the RPG program it does not
like my using a parameter value for the number of rows to fetch.
"Token ? was not valid. Valid tokens: ROW ROWS."

Is a variable not valid for FETCH ROWS? If not, can anyone point me in
the right direction. Thanks again.

Here is what I have:

D SelectSQL S 400A Inz('select * -

D from (select * -

D from ( select DiCono,-

D DiBstc, Didl01
D from F5301 -

D where DiMcu = ?
D order by DiCono
D fetch first ? -

D Rows Only -

D ) t1 -

D order by DiCono desc -

D fetch first ? rows only
D ) t2 -

D order by DiCono')

Prepare S1 from :SelectSQL ;

Declare C1 Cursor For S1 ;

Open C1 Using :InMCU, :nGetRecs, :InRecsPerPage ;

Fetch C1 for :InRecsPerPage Rows Into :OutDATA ;

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Walden H. Leverich
Sent: Wednesday, August 20, 2008 9:50 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: AW: Returning Record Sets from SQLRPGLE Web Services

OK, I'm confused then. Are you saying that the example program would no
longer run, or that it would continue to run, but would not have access
to the newly added column? The former disturbs me, but the latter makes
sense, and seems ok since it's unlikely my program would know what to do
with this new column since it wasn't there when the program was last


Walden H Leverich III
Tech Software
(516) 627-3800 x3051

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)

This thread ...


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

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