Re: caseless select
Posted in 1999
Nick
Yes, if you have version 7.31 and up. Something like:
select * from customers where lower(last_name) like lower("%$input%");
Note that there is a performance penalty because it will not use indexes that it
would otherwise have used had you not used lower, but in the query above, it
will not use indexes anyway, so I guess you have nothing to lose.
HTH
Sujit
heesters@copland.udel.edu (Nicholas Pieter Heesters Jr.) on 11/10/99 01:17:54 PM
Please respond to heesters@copland.udel.edu (Nicholas Pieter Heesters Jr.)
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: caseless select
Is there a way, in Informix, I can do a caseless select? Something
similar to a grep -i on a Unix box? I'm trying to find names in a
database, but the users sometimes enter the query in caps or lower
case or some combination. I'd like to do something like the following:
select * from customers where last_name like "%$input%";
But, if last_name has Johnson, JOHNSON or johnson as values I could
have $input = "john" and all three last_name values would be returned.
Is this possible?
Thank You,
Nick Heesters