True enough you could, but why?
SQL has the correct tools for the job!
True. So if you're only interested in the number, use SQL for performance. If you also want to display something from the same set, use DTML magic.
You could do this:
<dtml-let results="SQL_Select()"> #Results returned = <dtml-var "_.len(results)"> </dtml-let>
Mark
I've looked everywhere and I think this should be simple but I'm not
getting
it
I simply want to count the number of records generated by an ZSQL
Method
(SQL query) within a DTML Method (something like get the record count of that certain query). I then want to refer to this number (could be zero if there are no records) and say if this number is zero then do something, else do something else.
Can anyone help??
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )