How are you running the query and what are you doing with the data?

For what you are trying to do, a cursor with a block fetch is probably a better solution...

exec SQL declare cursor C1 for 'Select * from faplo';

exec SQL fetch C1 for 10 rows into :myArray;

This technique would be useful in a green screen subfile program.

If you want similar results in another environment, you'll probably have to handle things differently.


Charles Wilt
Software Engineer
CINTAS Corporation - IT 92B


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Srinivas Boggula
Sent: Wednesday, July 23, 2008 8:14 AM
To: Midrange Systems Technical Discussion
Subject: SQL Query : Fetch Next 10 rows

Hi All,

Each time when I run my query I need to fetch next 10 rows from a
Physical File

Example: First Time 10 rows (i.e. 1 to 10 rows)
Second time another 10 rows (i.e. 11 records to 20 records)
Third Time another 10 rows (i.e 21 records to 29
records) and so on....

I have tried with below query, but I'm confused how to increment RRN
value dynamically

SELECT * FROM faplo WHERE RRN(faplo) >= 10 and RRN(faplo) <= 20

Thanks in Advance

iGATE is Ranked No. 3 in DQ-IDC best IT employer survey and Ranked No.6
by Business Today-Mercer Human Resource Consulting-TNS in a cross
industry survey of Best Companies to work for in India
Information transmitted by this EMAIL is proprietary to iGATE Group of
Companies and is intended for use only by the individual
or entity to whom it is addressed and may contain information that is
privileged, confidential, or exempt from disclosure under
applicable law. If you are not the intended recipient of this EMAIL
immediately notify the sender at iGATE or mailadmin@xxxxxxxxx
and delete this EMAIL including any attachments

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page