Hi! I have problem. Could you help me? I have a ZSQLMethod, it contains "SELECT SUM(AMOUNT), NAME FROM LOG GROUP BY NAME" How can I reach the SUM value in dtml? <dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var ????> <dtml-in> I tried the : "SELECT SUM(AMOUNT) SUMMA, NAME FROM LOG GROUP BY NAME" <dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var SUMMA> <dtml-in> but it gives Error Type: KeyError Error Value: SZUMMA Thank you: Lajos Kerekes
Hi all. Hi Kerekes. ----- Original Message ----- From: "Kerekes Lajos" <lkerekes@xperts.hu> To: <zope@zope.org> Sent: Thursday, August 30, 2001 4:10 PM Subject: [Zope] ZSQL question
Hi!
I have problem. Could you help me? I have a ZSQLMethod, it contains "SELECT SUM(AMOUNT), NAME FROM LOG GROUP BY NAME" How can I reach the SUM value in dtml?
<dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var ????> <dtml-in>
I tried the : "SELECT SUM(AMOUNT) SUMMA, NAME FROM LOG GROUP BY NAME"
<dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var SUMMA> <dtml-in>
but it gives Error Type: KeyError Error Value: SZUMMA
Thank you:
Lajos Kerekes
Mmmm. I see a SQL question. Try "SELECT SUM(AMOUNT) AS SUMMA, NAME FROM LOG GROUP BY NAME"
_______________________________________________ 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 )
try the following: SELECT SUM(AMOUNT) AS MY_SUM, NAME FROM LOG GROUP BY NAME <dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var MY_SUM> <dtml-in> i suspect using just SUM(AMOUNT) leaves the resulting value with some indeterminate name or no variable name at all. so you must explicitly give that variable a name. jens On Thursday, August 30, 2001, at 10:10 , Kerekes Lajos wrote:
Hi!
I have problem. Could you help me? I have a ZSQLMethod, it contains "SELECT SUM(AMOUNT), NAME FROM LOG GROUP BY NAME" How can I reach the SUM value in dtml?
<dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var ????> <dtml-in>
I tried the : "SELECT SUM(AMOUNT) SUMMA, NAME FROM LOG GROUP BY NAME"
<dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var SUMMA> <dtml-in>
but it gives Error Type: KeyError Error Value: SZUMMA
Thank you:
Lajos Kerekes
_______________________________________________ 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 )
howdy, you access the fields (columns) of the result set by whatever name the RDBMS returns. it looks like yours would return the value in a column named "sum". so i'd try <dtml-var sum> your second select statement looks like it has a missing 'AS' select sum(amount) as summa, name from log.... in this case you would access via: <dtml-var summa> Kerekes Lajos wrote:
Hi!
I have problem. Could you help me? I have a ZSQLMethod, it contains "SELECT SUM(AMOUNT), NAME FROM LOG GROUP BY NAME" How can I reach the SUM value in dtml?
<dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var ????> <dtml-in>
I tried the : "SELECT SUM(AMOUNT) SUMMA, NAME FROM LOG GROUP BY NAME"
<dtml-in SelectMethod> Name: <dtml-var NAME>, Summary of amount: <dtml-var SUMMA> <dtml-in>
but it gives Error Type: KeyError Error Value: SZUMMA
Thank you:
Lajos Kerekes
_______________________________________________ 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 )
-- Tom Jenkins devIS - Development Infostructure http://www.devis.com
participants (4)
-
Antonio Carrasco -
Jens Vagelpohl -
Kerekes Lajos -
Tom Jenkins