[Zope] Z SQL Objects (Newbie)
Yvonne Totty
ytotty@atinucleus.com
Thu, 26 Oct 2000 09:44:51 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_005C_01C03F31.634E5800
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Error message stuff:
Expression (Python) Syntax error:
invalid syntax
, for tag <:if "team=='S'">, on line 23 of <string>
Traceback (innermost last):
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 222, in publish_module
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 187, in publish
File C:\PROGRA~1\ATIANY~1\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: TeamDates)
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 171, in publish
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: manage_edit)
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: manage_edit)
File C:\Program Files\ATIAnywhere\lib\python\Shared\DC\ZRDB\DA.py, line 242, in
manage_edit
(Object: TeamDates)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, line 383, in cook
(Object: <string>)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, line 228, in parse
(Object: <string>)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, line 292, in
parse_block
(Object: <string>)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, line 126, in
parse_error
(Object: <string>)
Document Template Parse Error: (see above)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yvonne Totty
Database Engineer
-------------------------
Wolverine: You actually go outside in these things?
Cyclops: Well, what would you prefer? Yellow spandex?
Hi,
Arguments | team
Query template
<dtml-if "team == '5'">
select *
from data
<dtml-else>
select *
from data
</dtml-if>
this is normal
but may it helps if you post the traceback of the error message
Jens Grewen
----- Original Message -----
From: Yvonne Totty
To: zope@zope.org
Sent: Thursday, October 26, 2000 3:22 PM
Subject: [Zope] Z SQL Objects (Newbie)
I have the O'Reilly book, but can't seem to find more
complete information on how to do 'if's' in a SQL thing.
Here's the scenario:
I have three different 'teams' and want to run a call
specific to each team. I am passing in three parameters,
two of which go in the sql statement, the other goes in
the if statement:
<:if "team='S"'>
sql statement
<:elif "team='C'">
blah, blah
</:if>
It tells me it doesn't like the syntax of the 'if' (I have
stuff in the python file that lets me use ':' in place of
'dtml-'). I have tried all the flavors: "team=='S'",
"team=S", "team==S", etc. and it doesn't like any of
them.
If you guys know of another reference, please let me
know!
TIA,
Yvonne 8)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yvonne Totty
Database Engineer
-------------------------
Wolverine: You actually go outside in these things?
Cyclops: Well, what would you prefer? Yellow spandex?
------=_NextPart_000_005C_01C03F31.634E5800
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D320003114-26102000>Error message stuff: </SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D320003114-26102000></SPAN></FONT><FONT face=3D"Comic Sans =
MS"><FONT=20
color=3D#000080><STRONG>Expression (Python) Syntax error</STRONG>: =
</FONT></DIV><PRE><FONT color=3D#000080>invalid syntax
</FONT></PRE>
<DIV><FONT color=3D#000080>, for tag <:if "team=3D=3D'S'">, on =
line 23 of=20
<string></FONT></DIV><FONT color=3D#000080>
<DIV><PRE>Traceback (innermost last):
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 222, =
in publish_module
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 187, =
in publish
File C:\PROGRA~1\ATIANY~1\lib\python\Zope\__init__.py, line 221, in =
zpublisher_exception_hook
(Object: TeamDates)
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 171, =
in publish
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\mapply.py, line 160, =
in mapply
(Object: manage_edit)
File C:\PROGRA~1\ATIANY~1\lib\python\ZPublisher\Publish.py, line 112, =
in call_object
(Object: manage_edit)
File C:\Program Files\ATIAnywhere\lib\python\Shared\DC\ZRDB\DA.py, =
line 242, in manage_edit
(Object: TeamDates)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, =
line 383, in cook
(Object: <string>)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, =
line 228, in parse
(Object: <string>)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, =
line 292, in parse_block
(Object: <string>)
File C:\PROGRA~1\ATIANY~1\lib\python\DocumentTemplate\DT_String.py, =
line 126, in parse_error
(Object: <string>)
Document Template Parse Error: (see above)
</FONT></FONT><FONT color=3D#000080 face=3D"Comic Sans =
MS">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</FONT></PRE></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS">Yvonne =
Totty</FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS">Database =
Engineer</FONT></DIV>
<DIV><FONT color=3D#000080=20
face=3D"Comic Sans MS">-------------------------</FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS">Wolverine: You =
actually go outside=20
in these things?<BR>Cyclops: Well, what would you prefer? Yellow=20
spandex?</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"BORDER-LEFT: #000080 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px">
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Arguments | =
team</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Query template</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><dtml-if "team =3D=3D =
'5'"></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> select *</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> from data</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><dtml-else></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2> select *</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> from =
data</FONT></DIV></FONT><FONT=20
face=3DArial size=3D2></dtml-if></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>this is normal</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>but may it helps if you post the =
traceback of the=20
error message</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Jens Grewen</FONT></DIV>
<DIV> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A href=3D"mailto:ytotty@atinucleus.com" =
title=3Dytotty@atinucleus.com>Yvonne=20
Totty</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
href=3D"mailto:zope@zope.org"=20
title=3Dzope@zope.org>zope@zope.org</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Thursday, October 26, =
2000 3:22=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Zope] Z SQL Objects =
(Newbie)</DIV>
<DIV><BR></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>I have the O'Reilly book, but can't seem =
to find=20
more</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>complete information on how to do 'if's' =
in a SQL=20
thing.</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000></SPAN></FONT> </DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>Here's the scenario:</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>I have three different 'teams' and want =
to run a=20
call</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>specific to each team. I am passing in =
three=20
parameters,</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>two of which go in the sql statement, the =
other=20
goes in </SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>the if statement:</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000><:if =
"team=3D'S"'></SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>sql statement</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000><:elif =
"team=3D'C'"></SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>blah, blah</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000></:if></SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000></SPAN></FONT> </DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>It tells me it doesn't like the syntax of =
the 'if'=20
(I have</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>stuff in the python file that lets me use =
':' in=20
place of</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>'dtml-'). I have tried all the flavors:=20
"team=3D=3D'S'",</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>"team=3DS", "team=3D=3DS", etc. and it =
doesn't like any=20
of</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>them.</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000></SPAN></FONT> </DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>If you guys know of another reference, =
please let=20
me</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>know!</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000></SPAN></FONT> </DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>TIA,</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>Yvonne 8)</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080=20
face=3D"Comic Sans =
MS">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS">Yvonne =
Totty</FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS">Database =
Engineer</FONT></DIV>
<DIV><FONT color=3D#000080=20
face=3D"Comic Sans MS">-------------------------</FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS">Wolverine: You =
actually go=20
outside in these things?<BR>Cyclops: Well, what would you prefer? =
Yellow=20
spandex?</FONT></DIV>
<DIV> </DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_005C_01C03F31.634E5800--