[Zope] Z SQL Objects (Newbie)

Yvonne Totty ytotty@atinucleus.com
Thu, 26 Oct 2000 10:41:07 -0500


Well, I will be darned, it did work. I must have
left out the quotes before when I tried it. That is
weird, how, in the very same object, the <:sqlvar...>
works, but <:if... > doesn't.

Thanks so much!!!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Yvonne Totty
Database Engineer
-------------------------
Wolverine: You actually go outside in these things?
Cyclops: Well, what would you prefer? Yellow spandex?

> Yvonne,
> 
> The format of your 'if' is incorrect:
> 
> You have <:if .....> it should be <dtml-if.....>
> 
> so the whole statement is as Jens says below.
> 
> hth
> 
> Phil
> phil.harris@zope.co.uk
> 
> 
> ----- Original Message ----- 
> From: Jens Grewen 
> To: ytotty@atinucleus.com 
> Cc: Zope Maillist 
> Sent: Thursday, October 26, 2000 2:51 PM
> Subject: Re: [Zope] Z SQL Objects (Newbie)
> 
> 
> 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?
> 
>