[turba] Case sensitive vs. case insensitive search
Liam Hoekenga
liamr@umich.edu
Mon, 17 Sep 2001 18:53:42 -0400
> > oracle does the same thing..
>
> case-sensitive by default? Can you tweak the table structure, or do you need
> a different query? ... etc.
>
> -chuck
after a quick hop on google.. it looks like it's actually the query that needs
to change..
"Yes. It's YOUR code that makes Oracle case insensitive. Example 1: in your
triggers, stored procedures, and any generic SLQ statements use the UPPER and
LOWER functions whenever comparing strings. Example 2: using Oracle 8i you can
create function based indexes like create an index on the city_name column
using the function UPPER(city_name). Then when your code queries for all cities
where UPPER(city_name) = 'somevalue' Oracle can use the index to find the
answer."
oracle has functions to conver stuff to all caps, or all lower - upper() and
lower() respectively..
select * from some_table where lower(some_table_field) =
lower($some_php_variable)
this also explains why i had to cover the table and field names to uppercase in
horde_prefs (as mentioned in one my posts this weekend on the IMP list)
Liam