Subject Re: Case sensitivity in WHERE clause (newbie question)
Author Aage Johansen
darryl_caillouet wrote:
> I just started using Firebird yesterday. I'm familiar with SQL Server
> and MySQL where filtering data using a WHERE clause is not case
> sensitive.
> In SQL Server, if I run:
> SELECT LastName FROM Employee WHERE LastName = 'Caillouet';
> It would return 'CAILLOUET', 'caillouet', 'Caillouet', 'CaIlLoUeT', etc.

Is this always the case (i.e. you cannot do case sensitive search)?


> Firebird is only returning the case-sensitive match of 'Caillouet'.
> In some case-sensitive databases, you can cast the search fields to
> upper or lower case to make the search case-insensitve:
> SELECT * FROM Employee WHERE UCASE(LastName) = UCASE('Caillouet');

select * from EMPLOYEE where Upper(LastName) = 'CAILLOUET'
No index will be used for LastName, and you may have to specify a collation
(for LastName).

Another (maybe better/simpler) way is to investigate case insensitive
collations (see http://www.brookstonesystems.com/).


Regards,
Aage J.