[Zope] ZSQLMethod sqltest with like and %

Neil Burnett neil@efc.be
Thu, 19 Jul 2001 16:09:07 +0200


Hi

I had trouble with getting this:

select * from qryPerson where Surname like '%urnet%'

(where I had given urnet as the search text.)

The following works, and as I couldn't find a solution in the docs or
mailing list, I thought I'd post it here for others as dumb as me to see:-)

<dtml-let Surname="'%' + Surname + '%'">
select * from qryPerson
where <dtml-sqltest Surname op=like type=string>
</dtml-let>

Mind you, I can't help thinking that the op=eq should be clever enough to
use 'like' when a string contains wildcards.

Regards

Neil

PS Note for database gurus: Yes, I know that searching with a wild card in
front negates my column index.