[Zope] dtml-sqltest op=like optional?

zopelist@robertson.net.nz zopelist@robertson.net.nz
Thu, 22 Aug 2002 10:30:08 +1200 (NZST)


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