Informix

Expand all | Collapse all

select next rows

  • 1.  select next rows

    Posted Mon March 15, 2021 09:39 AM
    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
    ------------------------------


  • 2.  RE: select next rows

    Posted Mon March 15, 2021 09:46 AM
    Select skip ..... 

    Cheers
    Paul

    Paul Watson
    Oninit LLC
    +1-913-387-7529
    www.oninit.com
    Oninit®️ is a registered trademark of Oninit LLC





  • 3.  RE: select next rows

    Posted Mon March 15, 2021 09:46 AM
    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
    ------------------------------



  • 4.  RE: select next rows

    Posted Mon March 15, 2021 09:50 AM
    As Paul hinted:

    SELECT SKIP 1000 FIRST 1000 * FROM emp;

    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: select next rows

    Posted Mon March 15, 2021 09:56 AM
    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





  • 6.  RE: select next rows

    Posted Tue March 16, 2021 02:53 AM
    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
    ------------------------------



  • 7.  RE: select next rows

    Posted Tue March 16, 2021 08:40 AM
    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
    ------------------------------



  • 8.  RE: select next rows

    Posted Thu March 18, 2021 05:05 PM
    Oh I see. Thank you so much for your info.

    ------------------------------
    BK8 Indonesia
    ------------------------------