Paginate query in Informix 7.31 TD6
Posted in 2013
Topics: General Discussion
Hello People of the Forum! I have a TD6 Informix 7.31 running on a Windows 2000 Server (I know it's old settings), but works for us very well. The problem that arises is that how I paginate a query result with many records. I'm doing a page in PHP and Informix database consulted for many things, among them to generate a list of debt collection with some users, this report is very large for the server and can not handle as it overflows the memory. Unfortunately, in this version I have Informix, there is no LIMIT like in MySQL. I had crossed my mind the option of using the ROWID to try to limit tovavía records but I have outlined this solution. I would appreciate if someone has a better solution for this problem. Of course, thank you for your kind attention. Greetings! Gustavo Echenique
Wrap the query in the SPL and restrict the number of returned rows ??? Cheers Paul -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of GUSTAVO ECHENIQUE Sent: Monday, June 03, 2013 7:27 AM To: ids@iiug.org Subject: Paginate query in Informix 7.31 TD6 [30402] Hello People of the Forum! I have a TD6 Informix 7.31 running on a Windows 2000 Server (I know it's old settings), but works for us very well. The problem that arises is that how I paginate a query result with many records. I'm doing a page in PHP and Informix database consulted for many things, among them to generate a list of debt collection with some users, this report is very large for the server and can not handle as it overflows the memory. Unfortunately, in this version I have Informix, there is no LIMIT like in MySQL. I had crossed my mind the option of using the ROWID to try to limit tovavía records but I have outlined this solution. I would appreciate if someone has a better solution for this problem. Of course, thank you for your kind attention. Greetings! Gustavo Echenique **************************************************************************** *** Forum Note: Use "Reply" to post a response in the discussion forum.
There is no LIMIT but there is FIRST <nrows> instead. Informix 7.31 did not support the SKIP <nrows> needed to easily get to the next batch of rows for the next "page", but you can add the ORDER BY column values from the last row you fetched (assuming they are unique) to the next query to eliminate the rows already fetched. Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Mon, Jun 3, 2013 at 8:26 AM, GUSTAVO ECHENIQUE < gustavo.echenique@cemdo.com.ar> wrote: > Hello People of the Forum! > > I have a TD6 Informix 7.31 running on a Windows 2000 Server (I know it's > old > settings), but works for us very well. > > The problem that arises is that how I paginate a query result with many > records. I'm doing a page in PHP and Informix database consulted for many > things, among them to generate a list of debt collection with some users, > this > report is very large for the server and can not handle as it overflows the > memory. > > Unfortunately, in this version I have Informix, there is no LIMIT like in > MySQL. I had crossed my mind the option of using the ROWID to try to limit > tovavía records but I have outlined this solution. > > I would appreciate if someone has a better solution for this problem. > > Of course, thank you for your kind attention. > > Greetings! > > Gustavo Echenique > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a11c262da2b597404de40eee4
Use a cursor instead... On 03 June 2013 at 15:39 Art Kagel <art.kagel@gmail.com> wrote: > There is no LIMIT but there is FIRST <nrows> instead. Informix 7.31 did > not support the SKIP <nrows> needed to easily get to the next batch of rows > for the next "page", but you can add the ORDER BY column values from the > last row you fetched (assuming they are unique) to the next query to > eliminate the rows already fetched. > > Art > > Art S. Kagel > Advanced DataTools (www.advancedatatools.com) > Blog: http://informix-myview.blogspot.com/ > > Disclaimer: Please keep in mind that my own opinions are my own opinions > and do not reflect on my employer, Advanced DataTools, the IIUG, nor any > other organization with which I am associated either explicitly, > implicitly, or by inference. Neither do those opinions reflect those of > other individuals affiliated with any entity with which I am affiliated nor > those of the entities themselves. > > On Mon, Jun 3, 2013 at 8:26 AM, GUSTAVO ECHENIQUE < > gustavo.echenique@cemdo.com.ar> wrote: > > > Hello People of the Forum! > > > > I have a TD6 Informix 7.31 running on a Windows 2000 Server (I know it's > > old > > settings), but works for us very well. > > > > The problem that arises is that how I paginate a query result with many > > records. I'm doing a page in PHP and Informix database consulted for many > > things, among them to generate a list of debt collection with some users, > > this > > report is very large for the server and can not handle as it overflows the > > memory. > > > > Unfortunately, in this version I have Informix, there is no LIMIT like in > > MySQL. I had crossed my mind the option of using the ROWID to try to limit > > tovavía records but I have outlined this solution. > > > > I would appreciate if someone has a better solution for this problem. > > > > Of course, thank you for your kind attention. > > > > Greetings! > > > > Gustavo Echenique > > > > > > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > --001a11c262da2b597404de40eee4 > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. >