dbTalk Databases Forums  

How to retrieve first 50 rows , next 50 rows and so on in Informix

comp.databases.informix comp.databases.informix


Discuss How to retrieve first 50 rows , next 50 rows and so on in Informix in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
KalpanaPai
 
Posts: n/a

Default How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-24-2003 , 10:06 PM






Hi All

Is there any equivalent command for SET ROWCOUNT or LIMIT in INFORMIX
to get the first 50rows, next 50 rows and so on if query returns 2500
rows .

So that the number of rows retrived for each page can be limited in
each session.

Any clues would be appreciated.
Thanks in Advance
Kalpana

Reply With Quote
  #2  
Old   
Danny De Koster
 
Posts: n/a

Default Re: How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-25-2003 , 04:22 AM






Hi,

You could declare a scroll cursor.
Using a counter you could fetch the first 50 records, doing a fetch next and
increase the counter
until 50 records are read.
But it would be nicer to limit the number of selected rows.
For example: select first 50...., select next 50...., select previous 50....
Is this possible?

Danny


"KalpanaPai" <kalpanapai (AT) hotmail (DOT) com> wrote

Quote:
Hi All

Is there any equivalent command for SET ROWCOUNT or LIMIT in INFORMIX
to get the first 50rows, next 50 rows and so on if query returns 2500
rows .

So that the number of rows retrived for each page can be limited in
each session.

Any clues would be appreciated.
Thanks in Advance
Kalpana



Reply With Quote
  #3  
Old   
Arthur Groen
 
Posts: n/a

Default Re: How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-25-2003 , 05:57 AM




Something like:

Select first 50 Table.* fron Table

/Arthur

----- Original Message -----
From: Danny De Koster <ddk (AT) fidelity-soft (DOT) be>
To: <informix-list (AT) iiug (DOT) org>
Sent: Monday, August 25, 2003 11:22 AM
Subject: Re: How to retrieve first 50 rows , next 50 rows and so on in
Informix


Quote:
Hi,

You could declare a scroll cursor.
Using a counter you could fetch the first 50 records, doing a fetch next
and
increase the counter
until 50 records are read.
But it would be nicer to limit the number of selected rows.
For example: select first 50...., select next 50...., select previous
50....
Is this possible?

Danny


"KalpanaPai" <kalpanapai (AT) hotmail (DOT) com> wrote in message
news:8b77f6f5.0308241906.21eb6f22 (AT) posting (DOT) google.com...
Hi All

Is there any equivalent command for SET ROWCOUNT or LIMIT in INFORMIX
to get the first 50rows, next 50 rows and so on if query returns 2500
rows .

So that the number of rows retrived for each page can be limited in
each session.

Any clues would be appreciated.
Thanks in Advance
Kalpana



sending to informix-list


Reply With Quote
  #4  
Old   
KalpanaPai
 
Posts: n/a

Default Re: How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-25-2003 , 04:27 PM



I know that
Select first 50* from Table will get only 50 rows
But i want to know from the application side , if the query returns
more rows , i want to get them in 50's and display and next 50 etc, in
that way the query will not kill the memory if more sessions are
connected without bringing the whole data to the buffer .

Any Solution ????????/
Thanks in advance
Kalpana



kalpanapai (AT) hotmail (DOT) com (KalpanaPai) wrote in message news:<8b77f6f5.0308241906.21eb6f22 (AT) posting (DOT) google.com>...
Quote:
Hi All

Is there any equivalent command for SET ROWCOUNT or LIMIT in INFORMIX
to get the first 50rows, next 50 rows and so on if query returns 2500
rows .

So that the number of rows retrived for each page can be limited in
each session.

Any clues would be appreciated.
Thanks in Advance
Kalpana

Reply With Quote
  #5  
Old   
preetinder dhaliwal
 
Posts: n/a

Default Re: How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-25-2003 , 08:09 PM




insert into temp ( as somebody already suggested ) , then fetch 50*,
then delete first 50 and then again 50* , or select min and max rowid
and use an approximation like ( max - min )/50 ( divide in 50's ecah ,
but ofcourse this set will have few rows ) and then select based on
rowids . If u want some other order, use any numeric key .

We used something similar in checkpointing - query will be like - where
prod_id > l_prod_id and batch_num > l_batch_num order by prod_id, batch_num

Rgds
Preetinder

KalpanaPai wrote:

Quote:
I know that
Select first 50* from Table will get only 50 rows
But i want to know from the application side , if the query returns
more rows , i want to get them in 50's and display and next 50 etc, in
that way the query will not kill the memory if more sessions are
connected without bringing the whole data to the buffer .

Any Solution ????????/
Thanks in advance
Kalpana



kalpanapai (AT) hotmail (DOT) com (KalpanaPai) wrote in message news:<8b77f6f5.0308241906.21eb6f22 (AT) posting (DOT) google.com>...


Hi All

Is there any equivalent command for SET ROWCOUNT or LIMIT in INFORMIX
to get the first 50rows, next 50 rows and so on if query returns 2500
rows .

So that the number of rows retrived for each page can be limited in
each session.

Any clues would be appreciated.
Thanks in Advance
Kalpana


sending to informix-list


Reply With Quote
  #6  
Old   
John Carlson
 
Posts: n/a

Default Re: How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-26-2003 , 08:30 AM



On 25 Aug 2003 14:27:45 -0700, kalpanapai (AT) hotmail (DOT) com (KalpanaPai)
wrote:

Quote:
I know that
Select first 50* from Table will get only 50 rows
But i want to know from the application side , if the query returns
more rows , i want to get them in 50's and display and next 50 etc, in
that way the query will not kill the memory if more sessions are
connected without bringing the whole data to the buffer .

What application / development language are you using?


Reply With Quote
  #7  
Old   
KalpanaPai
 
Posts: n/a

Default Re: How to retrieve first 50 rows , next 50 rows and so on in Informix - 08-26-2003 , 11:10 PM



Java , java script, JSP , HTML and Webserver is Tomcat

Thanks Heaps!!!!

John Carlson <john_carlson (AT) whsmithusa (DOT) com> wrote

Quote:
On 25 Aug 2003 14:27:45 -0700, kalpanapai (AT) hotmail (DOT) com (KalpanaPai)
wrote:

I know that
Select first 50* from Table will get only 50 rows
But i want to know from the application side , if the query returns
more rows , i want to get them in 50's and display and next 50 etc, in
that way the query will not kill the memory if more sessions are
connected without bringing the whole data to the buffer .


What application / development language are you using?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.