Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to fetch first 50 , next 50 etc in informix

Status
Not open for further replies.

kalpanapai

IS-IT--Management
Feb 10, 2003
9
NZ
I'd like to know if is it possible only to get a defined range of rows from informix.
That is, I'd want to recover rows from number 1 to 50 the first time, from number 51 to 100 the second time, from 101 to 150 the third time, and so on...
and display from the java application , so that it can limit the resource usage for each session if query returns more rows say 10000 rows.

MySQL has a LIMIT clause and SET ROWCOUNT in Sybase.

I would really appriciate any ideas, suggestions in this regard .
Thanks & regards
kalpana
 
Hi,

I do not think such a clause is available even under the extended SQL provided by the Informix. However, there is a clause called "first" available to fetch the number of rows specified as a first batch, out of a huge set of rows. Incidentally, there no such keyword as next or rest!

select first 10 * from customer;
select first 5 col1,col5,col8 from tab1;

Regards,
Shriyan

"If you have knowledge, let others light their candles with it."
 
Hi Shriyan
Thanks for your reply.

The Clause "First" will not serve the purpose, as one of the developer wants to restrict the number rows returned from the large query , so that she can display in 50's .

She wants to know is that possible to write in Sql,
i am working on Web datablades which has some attributes like MAXROWS,WINSIZE, etc of MISQL Tag , i am not quite sure whether we can use them in java application (Our Application).

Any light???

Thanks
kalpana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top