[Zope] calling ZSQL "in place"

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Wed, 05 Jan 2000 15:57:07 +1100


>>> Timothy Wilson wrote
> Hi everyone,
> 
> I'd like to print the total number of records in a database table and
> print that number on my page. My ZSQL method looks like:
> 
> SELECT COUNT(*) FROM foo_table
> The method returns the correct number when I test it.
> I'd like to print the following:
> There are [insert SQL result here] records in the database.

sql:

 select COUNT(*) as cnt from foo_table

dtml:

 There are <dtml-in sqlmeth size=1><dtml-var cnt></dtml-in> records in the 
 database.

Anthony