Case Insensitive searching in Firebird

Posts   
 
    
mthird
User
Posts: 2
Joined: 15-Nov-2004
# Posted on: 15-Nov-2004 23:29:54   

I saw a previous thread where a poster was asking about case insensitive searching and that it was already implimented. I tried it with Firebird and noticed that the case where CaseSensitiveCollation = false IS case-sensitive and CaseSensitiveCollation = true doesn't return any rows.

One way I saw to impliment this in Firebird is with the CONTAINING keyword. Works just like LIKE except it is case-insensitive, but it has the nasty side-effect of ignoring indexes.

Anything obvious I'm missing?

Michael

BTW - Love this product!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 16-Nov-2004 10:36:13   

mthird wrote:

I saw a previous thread where a poster was asking about case insensitive searching and that it was already implimented. I tried it with Firebird and noticed that the case where CaseSensitiveCollation = false IS case-sensitive and CaseSensitiveCollation = true doesn't return any rows.

It might be a bit confusing. CaseSensitiveCollation is a flag which you should set to true if the database uses a case sensitive collation. SqlServer for example by default does not. Firebird, Oracle etc. do. So if that's the case, which it is with firebird, set it to true. When you do that, the UPPER() (or equivalent for the particular platform) is applied to the field. This means that you have to supply the pattern in all capitols.

So if you want all customers which have a company name matching a%, no matter the casing, you should set CaseSensitiveCollation to true and specify A% as the pattern.

BTW - Love this product!

smile

Frans Bouma | Lead developer LLBLGen Pro