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



One way:

c eval stmt = 'select * from aFile etc'

C/EXEC SQL
C+ PREPARE sel FROM :stmt
C/END-EXEC
C/EXEC SQL
C+ DECLARE c1 SCROLL CURSOR FOR SEL
C/END-EXEC
C/EXEC SQL
c+ open c1
c/END-EXEC

* then loop for what you want when you need them
c fetcher begsr
c do until you have what you want or sqlcod != *zero
c/EXEC SQL
c+ fetch next from c1
c+ INTO :ds4afile
c/END-EXEC
c if sqlcod = *zero
c exsr performYourProcess
c endif
enddo
c endsr


________________________________________
From: midrange-l-bounces@xxxxxxxxxxxx [midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Srinivas Boggula [Srinivas.Boggula@xxxxxxxxx]
Sent: Wednesday, July 23, 2008 8:13 AM
Subject: SQL Query : Fetch Next 10 rows
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
Regards,
Srinivas

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.