[Zope] limiting no. of records retrieved

vsbabu@vsbabu.org vsbabu@vsbabu.org
Sun, 18 Aug 2002 11:47:00 -0400


Hi,

You don't need to use LIMIT at all in your query.

You can use Zope's batching functionality to do this.

If you use dtml, dtml-in has sequence-batches, next-sequence etc
to do this.

http://www.zope.org/Documentation/Books/ZopeBook/current/AppendixA.stx

- Satheesh Babu
http://vsbabu.org/

On Sun, Aug 18, 2002 at 03:53:08PM +0100 or thereabouts, Greg Conway wrote:
> Hi all,
> 
> I've been trying to limit the no. of records retrieved by a MySQL query.
> 
> I've managed to do this, using LIMIT, and have built this into my Zope app,
> but....
> 
> How can I retrieve the number of records that would have been retrieved if I
> hadn't limited the Query?
> 
> So I can display something like 'display records 1 - 30 of 250', if you see
> what I mean.
> 
> The MySQL documentation tells me I can do it using the FOUND_ROWS()
> command - if I am using version 4.0 + of MySQL! which I am not.
> 
> So, is there a way of achieving this in Zope? Seeing as it's so cool at
> everything else!!
> 
> Many thanks for any help!
> 
> Regards,
> 
> Greg Conway.