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
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 )
participants (2)
-
Charlie Reiman -
zopelist@robertson.net.nz