[Zope] Sql statement in dtml code

Joe Bezier joebezier at yahoo.co.uk
Fri Sep 9 06:46:17 EDT 2005


OK, are you using a Zope with an error_log? [you'll see it in the root 
of your installation]. If so, could you pass on the whole traceback for 
this error?

Hang on - are you calling 'date_count' when your object's called 
'date_count.zsql'? Rename your zsql method 'date_count' and then try - 
I think that should do it. If not, send us the traceback...

Cheers

JB
On 9 Sep 2005, at 11:33, paul.hendrick at gmail.com wrote:

> sorry, i meant when i run the code - i'm not with zope terminology yet.
> here's my date_count.zsql method:
> select count(*) AS endcount from t_transaction
>
> and in the dtml, i've got:
>         <dtml-in date_count>
>             <dtml-var endcount>
>         </dtml-in>
>
> Thanks for the replies so far!
> Paul
>
> On Fri, 2005-09-09 at 11:30 +0100, Peter Bengtsson wrote:
>> When the page is refreshed??? It shouldn't matter. It's got to be
>> something wrong with the SQL statement.
>>
>> A ZSQL method doesn't really have "an output", you have to loop over
>> it and get the "output" for each key in the iterations.
>>
>> On 9/9/05, paul.hendrick at gmail.com <paul.hendrick at gmail.com> wrote:
>>> Hi Joe,
>>> thanks for the quick reply!
>>> i've got a zsql method now(called date_count.zsql) which I try to 
>>> call
>>> in my dtml via <dtml-in date_count> - but I get a KeyError when the 
>>> page
>>> is refreshed. The dtml is in the same dir as the zsql...not sure 
>>> whats
>>> up.
>>>
>>> Cheers,
>>> Paul
>>>
>>> On Fri, 2005-09-09 at 11:06 +0100, Joe Bezier wrote:
>>>> I'm not sure if this is what you're looking for
>>>>
>>>> <dtml-in
>>>> expr="sql_statement(parameter1=parameter1,parameter2=parameter2)">
>>>> <dtml-var column_name>
>>>> </dtml-in>
>>>>
>>>> If no parameters, just expr="sql_statement()" or <dtml-in 
>>>> sql_statement>
>>>>
>>>> Cheers,
>>>>
>>>> JB
>>>>
>>>>
>>>> On 9 Sep 2005, at 10:50, paul.hendrick at gmail.com wrote:
>>>>
>>>>> Hi all,
>>>>> I'm trying to basically get the output of two SELECT statements 
>>>>> into a
>>>>> dtml document, but cant get it working.
>>>>> I've searched, and tried a few examples for similar things, but 
>>>>> had no
>>>>> luck. Can anyone recommend a way, please?
>>>>>
>>>>> Thanks,
>>>>> Paul
>>>>>
>>>>> _______________________________________________
>>>>> Zope maillist  -  Zope at 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 )
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ___________________________________________________________
>>>> Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide 
>>>> with voicemail http://uk.messenger.yahoo.com
>>>>
>>>
>>> _______________________________________________
>>> Zope maillist  -  Zope at 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 )
>>>
>>
>>
>


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com


More information about the Zope mailing list