Hello. Does anyone know if there is a way to determine how many rows where retrieved by a select statement? Is there a variable that keeps track of this in Zope that I can access? Any help would be greatly appreciated. Thanks. - Asad
ZSQL methods have a such a parameter.: ZMI-> Properties. This parameter is used by *some* DAs. So this is specific to the database and its adapater but *not* to the ZSQL method itself since it is independent of the database by design. -aj --On Dienstag, 6. Januar 2004 9:50 Uhr -0500 Asad Habib <ahabib@engin.umich.edu> wrote:
Hello. Does anyone know if there is a way to determine how many rows where retrieved by a select statement? Is there a variable that keeps track of this in Zope that I can access? Any help would be greatly appreciated. Thanks.
- Asad
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Tue, 6 Jan 2004 09:50:55 -0500 (EST) Asad Habib <ahabib@engin.umich.edu> wrote:
Hello. Does anyone know if there is a way to determine how many rows where retrieved by a select statement? Is there a variable that keeps track of this in Zope that I can access? Any help would be greatly appreciated. Thanks.
SELECT count(*) FROM mytable WHERE myconstraints; or given a resultset from a zsql method: len(results) However the latter may have an upper limit set by the zsql method or the query itself (using the SQL LIMIT keyword) and so may not actually return the full count. -Casey
Well, one way is to use COUNT in the query -- SELECT COUNT(*), ... On Tue, 6 Jan 2004, Asad Habib wrote:
Hello. Does anyone know if there is a way to determine how many rows where retrieved by a select statement? Is there a variable that keeps track of this in Zope that I can access? Any help would be greatly appreciated. Thanks.
- Asad
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Andreas Jung -
Asad Habib -
Casey Duncan -
Dennis Allison