[Zope] dtml-sqltest op=like optional?

Chris Beaven Chris@d-designz.co.nz
Thu, 22 Aug 2002 12:40:24 +1200


It should be:

<dtml-sqltest name op=like type=nb multiple optional>

-----Original Message-----
From: Charlie Reiman [mailto:creiman@kefta.com]
Sent: Thursday, 22 August 2002 11:36 a.m.
To: zopelist@robertson.net.nz; zope@zope.org
Subject: RE: [Zope] dtml-sqltest op=like optional?


It has been a while since I tried this with sqltest, but have you tried the
'nb' flag as well?

<dtml-sqltest  name op=like type=string multiple optional nb>

My impression was optional and string didn't do what I wanted unless the nb
option was also set.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> zopelist@robertson.net.nz
> Sent: Wednesday, August 21, 2002 3:30 PM
> To: zope@zope.org
> Subject: [Zope] dtml-sqltest op=like optional?
>
>
> Greetings,
> I am trying to get
>
> select * from customer
> <dtml-sqlgroup where>
> <dtml-sqltest id op=gt type=int optional>
> <dtml-and>
> <dtml-sqltest name op=like type=string multiple optional>
> <dtml-and>
> <dtml-sqltest contact op=like type=string multiple optional>
> </dtml-sqlgroup>
>
> to work - my intention is that none or more variables are needed.
>
> It seems that unless the type is int, I get
>
> select * from customer
> where
> (name like ''
>  and contact like ''
> )
>
> Is there anyway around this or to default the value of name and
> contact to '%' without lots of dtml-if statements?
>
> (actually - the like statement does not enter the wild card so
> like='Acme' does not return Acme Corp)
>
> BTW - connecting to a Postgres DB - if that makes a difference
>
> Don
>
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>


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