Re: Case sensitivity = property of column, table or database?

From: Bob Hairgrove <rhairgroveNoSpam_at_Pleasebigfoot.com>
Date: Mon, 15 Apr 2002 12:52:00 GMT
Message-ID: <3cbacb14.19666979_at_news.ch.kpnqwest.net>


On Mon, 15 Apr 2002 13:24:40 +0100, "Bill Rayer" <william.rayer_at_virgin.net> wrote:

>So to get to my question finally: If I store strings in a table
>using mixed case, and I want to be able to search for them using
>a case insensitive search, how can I get efficient O(log(N)) access?

Case depends on locale. For example, in Swiss German, the upper case of "ä" is not "Ä", as in Germany or Austria, but "Ae". The same applies to the other Umlaute. A true case-insensitive search would have to take both spellings into account if it did not differentiate between locales.

Also, alphabetical sorting varies tremendously between locales. In Germany (I believe), "ä" is sorted equivalently to "ae" and can occur interspersed in a list among words beginning with "ae". In Austria, I believe the sort order is different (or perhaps it is the other way around).

Standard C++ strings take an optional locale template argument (a "facet"). Since I never had to work with facets, I'll merely point out that they exist and have an effect on the sort order.

Are you sure you really want to do this? <VBG> If you restrict your language's database capabilities to users of the English language, you could get away with an assembler function which subtracted 32 (or masked off that bit) from the character's ASCII code...

Bob Hairgrove
rhairgroveNoSpam_at_Pleasebigfoot.com Received on Mon Apr 15 2002 - 14:52:00 CEST

Original text of this message