Subject Re: [firebird-support] Matching regarding primary differences
Author Svein Erling Tysvaer
Those of us who are lucky enough to use IBO, have a property associated
with TIB_Query which allow us to use a column which is the uppercase
equivalent (you can use it as a lowercase equivalent if you prefer that) of
the column you display. Then we use this uppercase equivalent for
searching, but only display the propercase column. Of course, we need to
write triggers to fill the uppercase column and it does take some extra
storage space, but this should pretty easily fix your problem with treating
some characters as if they were different when searching.

As for displaying the next row even if it does not start quite as it ought
to, >= is the only way I can think of.

Set

At 12:20 23.06.2003 +0000, you wrote:
>For implementing incremental search in a GUI,
>I'm looking how to write a SELECT, which will
>find all rows where a columns starts with a
>specific string (as in LIKE('abc%')), but taking
>into account only primary character differences
>(disregarding case and accents).
>
>I'm aware of using David Schnepper's work on
>nocase and nocase/noaccent collations, but after
>thinking again about the problem, it seems better
>to try to solve the problem without them (as I want
>the output sorted according all differences).
>
>What's missing so far is a method how to 'increment'
>the search string to next string of equal length sorting
>higher according to primary differences.
>
>This 'incrementing' would return 'abd' for 'abc', and 'ac_' or
>'abä' (depending on locale, err... collation) for 'abz'.
>
>Having this incremented string the query would like
>(:search holding the looked for string, :next holding
>the incremented string):
>
> > select col from t where
> > (col >= upper(:search) or col >= lower(:search)) and
> > col < upper(:next) and col < lower(:next);
>
>The upper/lower thing must be done as it varies from collation
>to collation which casing sorts lower. I hope it don't vary
>from collation to collation that the unaccented letter sort
>lower.
>
>Any ideas for implementing the 'increment'?
>
>Any alternatives for this requirements?
>
>Best Regards,
>Peter Jacobi,
>Hamburg, Germany