Zsql case insensative search
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%' Most of this works great via sqltest, the one exception is calling the upper sqlfunction on the field. I can't seem to find a way to do this. If I stop using the dtml sql tags then the sql method becomes much more complex. Any ideas are welcome. __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com
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
participants (2)
-
Eric Merritt -
Tino Wildenhain