[Zope] case-insensitive searches

Maggie Shapland Maggie.Shapland@bristol.ac.uk
Wed, 17 Jan 2001 16:52:09 +0000


I wrote:
>How does one do a case-insensitive search using sql 
>methods when the underlying database is case-sensitive? Although I can 
>force the search on the database to look for a lower case string, I 
>cant make the person giving the value give me the value in lower case, 
>and I know I shouldnt use dtml-var due to security reasons.
>I guess I really want the dtml-var attributes implemented 
>in sql-var since 
>lower(fieldname) like <sql-var "'%' + fieldname + '%'" 
>  type=string lower> 
>does a case sensitive search whereas:
>lower(fieldname) like '%<dtml-var fieldname lower>%' 
>works fine since it forces the user input to lower case 
I realise one can force the case of the input by an extra call in the 
report before the dtml-in clause
eg <dtml-call "REQUEST.set('car', _.string.lower(REQUEST['car']))">
but it would still be nice to be able to include lower as an attribute 
to sqlvar.
By the way I am trying to document SQL solutions (relating to Oracle) 
as I hit them in:
http://www.cse.bris.ac.uk/~ccmjs/zope_sql.htm
----------------------
Maggie Shapland, Computing Service, University of Bristol, Tyndall Av, 
Bristol BS8 1UD
Tel: 0117-9289869 (Int 9869)
Email: Maggie.Shapland@bristol.ac.uk
Web page: http://www.cse.bris.ac.uk/~ccmjs/
1925 Lanchester 21, 1925 Talbot 10/23, 1929 Peugeot 190S, 1986 Moss 
Monaco