[Zope] SQL LIKE

cesare@planningsrl.it cesare@planningsrl.it
Wed, 12 Jan 2000 15:28:30 GMT


Hi all!

I would like to do a form in which the user can edit few words (separated 
by a blank character).

When the user press the "Search" button I would like to use those words to 
search in a field of a table.

I have done it but I have two  problems:

1) I use sqlgroup but I can use it just with the = and not with the LIKE 
statement
select  * from annunci
<dtml-sqlgroup where>
   <dtml-sqltest Parola column=testo type=string optional>
</dtml-sqlgroup>

the result is:

select * from annunci
where Parola="Word"

but I would like this result:

select * from annunci 
where Parola LIKE "%Word%"

2) I am not able to divide the words in more conditions. I would like the 
following result:
select * from annunci 
where testo LIKE "%FirstWord%" and testo LIKE "%SecondWord%"


Thank you in advance,
Cesare
Cesare Raoss
Planning srl
Via Bolzano 45
38014 Gardolo (TN)
cesare@planningsrl.it
http://www.planningsrl.it