select next rows
Posted in 2021
Amit Patel asked how to select the next rows (1001-2000) in Informix 11.70. Paul Watson and Art Kagel answered with SELECT SKIP 1000 FIRST 1000 * FROM emp. Henri Cujass suggested an SPL routine, and Art added that a cursor or scroll cursor can walk through a result set. Solved.
Topics: General Discussion
Hello All, How can I select Next few rows . e.g. SELECT FIRST 1000 * FROM emp ----> it will give me first 1000 record. But if I need next 1001 - 2000 rows , then how can I select in Informix 11.70? Kindly guide. Thanks Amit Patel ------------------------------ AMIT PATEL ------------------------------ #Informix
Select skip .....Cheers
Paul
Paul Watson
Oninit LLC
+1-913-387-7529
www.oninit.com
Oninit® is a registered trademark of Oninit LLC
I checked in google and found below syntax :
SELECT SKIP 1000 FIRST 1000 * FROM emp ; ---- it will skip first start 1000 records and will show next 1000 rows;------------------------------
AMIT PATEL
------------------------------
As Paul hinted:
SELECT SKIP 1000 FIRST 1000 * FROM emp;------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
------------------------------
I would have been more expansive but as most of posts to the forums are delays by 24+ hours ..... Cheers Paul Paul Watson Oninit LLC +1-913-387-7529 www.oninit.com Oninit® is a registered trademark of Oninit LLC
Hi Amit, I prefer a small SPL routine in the case to go step by step through the result set - more flexible. Regards Henri ------------------------------ Henri Cujass leolo IT, CTO Germany ------------------------------
FWIW, in an application you can also use a CURSOR to process portions of a result set fetched without the FIRST <n> clause. Also you can use a SCROLL CURSOR to move forward and backward through a result set! ------------------------------ Art S. Kagel, President and Principal Consultant ASK Database Management Corp. www.askdbmgt.com ------------------------------
Oh I see. Thank you so much for your info. ------------------------------ BK8 Indonesia ------------------------------