[Zope] Zsql case insensative search

Tino Wildenhain tino at wildenhain.de
Fri Oct 3 15:30:22 EDT 2003


Hi Eric,

Eric Merritt wrote:
> Hello all,
> 
>  I am attempting to make a case insensative search via
> sql and odbc. Everything works and the dtml sql tags
> are awesome for dynamic queries. However, I have run
> into one problem whan it comes to a case insensative
> search. In strait sql the search is pretty easy ie:
> 
>  select * from some_table where upper(field) like
> '%AVALUE%'
> 

select your,data from some_table where upper(field)
like <dtml-sqlvar avalue type=string>


1.) Never use SELECT * FROM ... in production code
2.) see if your Database has an ilike too.
3.) the above code asumes your avalue is already upper()


Regards
Tino Wildenhain




More information about the Zope mailing list