[Zope] help with dtml and sql---counting database rows with sql method

Kelley, Sean SKelley@ci.santa-rosa.ca.us
Thu, 17 Apr 2003 15:55:44 -0700


Hi,

I am trying to count database rows in a table by using the following call to
the sql method:

<dtml-call counter>

In my counter zsql method I pass in no parameters.  My sql script is:

SELECT count(*) 
FROM IWPLNCHK

This query works outside of zope but returns an error that no column name is
assigned to the value.  So I name to the resultant column:

SELECT count(*) as p2_count
FROM IWPLNCHK

which work in an sql test in zope but still does not output the count value
to the calling page.  How do I pass this value back and display it?

thanks, Sean