Subject | Re: How to 'upper' characters with accents? |
---|---|
Author | Adam |
Post date | 2006-07-14T02:04:36Z |
--- In firebird-support@yahoogroups.com, "phil_hhn" <time_lord@...>
wrote:
Firebird 2 will introduce the ability to index an expression, such as
UPPER(MyText), but once you read about collations and figure out the
best one to use, it may not be relevant.
Adam
wrote:
>contain
> Hi, I'm currently using Firebird 1.5.3.
>
> I have a column called 'MyText', varchar(100). This column may
> works with accents, eg "hát" (the second character has an accent -it
> is U 00E1). For searching purposes, I need to be able to find thiscolumn
> word regardless of case. Always performing an 'UPPER()' on this
> is slow (there are a lot of rows), so for performance I addedanother
> column 'MyUText'.a
>
> In IBExpert I ran 'update MyTable set MyUText = upper(MyText)', but
> this does not convert all characters; in the above example "hát"
> becomes "HáT" (the second character was not uppercased).
>
> 1) Is it possible for firebird to 'upper' characters with accents
> also? Do I need to change the way the MyUText column is defined (eg
> particular codeset)? I accepted all defaults, locales, codesets, etc(1)
> when I first created the database.
>
> 2) Is it possible for firebird to convert accented characters to
> non-accented ones (where an equivalent exists)? Then for example I
> could search for "HAT" and find "hát" (where the equivalent -
> uppercased - was "HAT").
>
> 3) I need to add a trigger so that whenever MyText is modified (or a
> row added) then MyUText is updated. This may only be practical if
> is possible; otherwise, I'll have to do the conversion through myjava
> code. Since MyText is updated from many different areas, a triggerRead about COLLATIONS.
> would be preferable.
>
> Any comments? Are there any enhancements in Firebird v2 that are
> relevant here?
Firebird 2 will introduce the ability to index an expression, such as
UPPER(MyText), but once you read about collations and figure out the
best one to use, it may not be relevant.
Adam