Showing value returned by Z SQL Method
Newbie question: How do I get the value of the Z SQL Method "count" which returns only the result of SELECT COUNT(*) ? <dtml-call "REQUEST.set('myCount',_.int(count))"> didn't work. Thanks for any help. Anclo
If I understand your question you have a sql method like sql method: sel_tab_count select count(*) as count from table_name Create a dtml method called: show_count <dtml-in sel_tab_count> <dtml-var count> </dtml-in> That should do it, Also you might want to look at adding a Z Search Interface from the drop down box in the upper right corner and bind it to your sql method. Have a look at the syntax it generates.. Hope this helps. Todd ----- Original Message ----- From: Anclo <anclo@anclo.com> To: <zope@zope.org> Sent: Sunday, February 10, 2002 1:43 PM Subject: [Zope] Showing value returned by Z SQL Method
Newbie question: How do I get the value of the Z SQL Method "count" which returns only the result of SELECT COUNT(*) ?
<dtml-call "REQUEST.set('myCount',_.int(count))"> didn't work.
Thanks for any help.
Anclo
_______________________________________________ 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 )
At 06:45 PM 2/10/2002, you wrote:
If I understand your question you have a sql method like
sql method: sel_tab_count
select count(*) as count from table_name
Create a dtml method called: show_count
<dtml-in sel_tab_count> <dtml-var count> </dtml-in>
That should do it, Also you might want to look at adding a Z Search Interface from the drop down box in the upper right corner and bind it to your sql method. Have a look at the syntax it generates..
Hope this helps.
Todd
Todd, many thanks. Actually I looked at the Z Search Interface and this is the syntax used if your SQL method is named "count": <dtml-in count> <dtml-var expr="_['COUNT(*)']"> </dtml-in> Anclo
participants (2)
-
Anclo -
Todd Graham