> if foo in (select foo_col from table where x=y)
> then z='t'
> else z='f'
>
> I tried putting the simple SELECT query into a zSql and then calling it
> like:
>
> <dtml-call "REQUEST.set('foo_list',IfShowNextDoor())">
> <dtml-if expr="foo in foo_list">
>       <dtml-call "REQUEST.set('z','t')">
> <dtml-else>
>       <dtml-call "REQUEST.set('z','f')">
> </dtml-if>
How about checking the database table for foo rather than the result set:

ZSQL method name=select
argument=foo
select foo_col from table where foo_col =<dtml-sqlvar foo type="string">

then do:
<dtml-in select>
<dtml-call "REQUEST.set('z','t')">
> <dtml-else>
>       <dtml-call "REQUEST.set('z','f')">
> </dtml-in>

If the variable is in table then dtml-in returns a result set and the 
<dtml-call "REQUEST.set('z','t')"> is called, if not the dtml-else is called.

HTH
Regards
Garry
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to