[Zope] Z SQL Objects (Newbie)

Jens Grewen zope@grewen.de
Thu, 26 Oct 2000 15:51:08 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0021_01C03F64.8EB0BA00
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

Arguments |  team

Query template

<dtml-if "team =3D=3D '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 -----=20
  From: Yvonne Totty=20
  To: zope@zope.org=20
  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=20
  the if statement:
  <:if "team=3D'S"'>
  sql statement
  <:elif "team=3D'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=3D=3D'S'",
  "team=3DS", "team=3D=3DS", 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_0021_01C03F64.8EB0BA00
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Arguments&nbsp;|&nbsp; =
team</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Query template</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-if "team =3D=3D =
'5'"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; select *</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; from data</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;dtml-else&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>&nbsp; select *</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; from =
data</FONT></DIV></FONT><FONT=20
face=3DArial size=3D2>&lt;/dtml-if&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>this is normal</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>but may it helps if you post the =
traceback of the=20
error message</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jens Grewen</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dytotty@atinucleus.com =
href=3D"mailto:ytotty@atinucleus.com">Yvonne=20
  Totty</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A title=3Dzope@zope.org=20
  href=3D"mailto:zope@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=20
  (Newbie)</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN =
class=3D550060513-26102000>I=20
  have the O'Reilly book, but can't seem to find =
more</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>complete information on how to do 'if's' in =
a SQL=20
  thing.</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>Here's the scenario:</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN =
class=3D550060513-26102000>I=20
  have three different 'teams' and want to run a =
call</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>specific to each team. I am passing in =
three=20
  parameters,</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>two of which go in the sql statement, the =
other goes=20
  in </SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>the if statement:</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>&lt;:if =
"team=3D'S"'&gt;</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>sql statement</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>&lt;:elif =
"team=3D'C'"&gt;</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>blah, blah</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>&lt;/:if&gt;</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>It tells me it doesn't like the syntax of =
the 'if' (I=20
  have</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>stuff in the python file that lets me use =
':' in=20
  place of</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>'dtml-'). I have tried all the flavors:=20
  "team=3D=3D'S'",</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>"team=3DS", "team=3D=3DS", etc. and it =
doesn't like any=20
  of</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>them.</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>If you guys know of another reference, =
please let=20
  me</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>know!</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>TIA,</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080><SPAN=20
  class=3D550060513-26102000>Yvonne 8)</SPAN></FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS"=20
  color=3D#000080>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080>Yvonne =
Totty</FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080>Database =
Engineer</FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS"=20
  color=3D#000080>-------------------------</FONT></DIV>
  <DIV><FONT face=3D"Comic Sans MS" color=3D#000080>Wolverine: You =
actually go=20
  outside in these things?<BR>Cyclops: Well, what would you prefer? =
Yellow=20
  spandex?</FONT></DIV>
  <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0021_01C03F64.8EB0BA00--