Re: LIMIT clause in Informix selects?
Posted in 1999
From: Douw Steyn <douwl@saba.vis.co.za> > >I can't find a LIMIT clause (or equivalent) for the SELECT syntax in the >Informix SQL documentation. > >What I am looking for is the syntax to get only rows X to Y from a >select result set returned to me. I did find the SELECT FIRST X syntax, >but this doesn't appear capable of returning an arbitrary set of rows. > >Am I missing something, or can Informix not do this? > >I would like to do this in order to present a long list of results in a >set of short sections with next/previous buttons. Use a cursor. In pseudo code: MAIN -- declare and open cursors and set up variables CALL get_rows(1, 10) END MAIN FUNCTION get_rows (start_row, end_row) DEFINE start_row, end_row INT FOR i = start_row TO end_row FETCH ABSOLUTE i cursorname INTO variables END FOR END FUNCTION Other approaches are valid, but you get the idea... :-) ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com