[Zope] Z SQL Objects (Newbie)

Yvonne Totty ytotty@atinucleus.com
Thu, 26 Oct 2000 08:22:47 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_002A_01C03F25.EBF02E60
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

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_002A_01C03F25.EBF02E60
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></HEAD>
<BODY>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN =
class=3D550060513-26102000>I=20
have the O'Reilly book, but can't seem to find 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>&nbsp;</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 =
class=3D550060513-26102000>I=20
have three different 'teams' and want to run a 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 =
class=3D550060513-26102000>two=20
of which go in the sql statement, the other goes in </SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN =
class=3D550060513-26102000>the=20
if statement:</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>&lt;:if "team=3D'S"'&gt;</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN =
class=3D550060513-26102000>sql=20
statement</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000>&lt;:elif =
"team=3D'C'"&gt;</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>&lt;/:if&gt;</SPAN></FONT></DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN=20
class=3D550060513-26102000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN =
class=3D550060513-26102000>It=20
tells me it doesn't like the syntax of the 'if' (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 place=20
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>&nbsp;</DIV>
<DIV><FONT color=3D#000080 face=3D"Comic Sans MS"><SPAN =
class=3D550060513-26102000>If=20
you guys know of another reference, please let 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>&nbsp;</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 outside=20
in these things?<BR>Cyclops: Well, what would you prefer? Yellow=20
spandex?</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_002A_01C03F25.EBF02E60--