Subject Re: [firebird-support] Re: Remove selected chars from results' field
Author Aage Johansen
KamiHĂ­r wrote:
> Hi!
>
> Thank you for the lighting fast answer. I would happy with exact match
> because
>
> WHERE LANG1='something' could be very different.
> I doesn't know the form of searched string...
> It may be like:
> something
> something...
> ~something
> some~thing
> so~mething...
>
> So I don't know how to do the match. In my opinion if I remove ~ and ...
from LANG1 (also pre/post spaces and whitespaces) I will get a better
match. I think I should use procedure and call it like:
> SELECT STRIPUNNECESSARYCHARS(LANG1) AS STRIPED, LANG2 FROM TRANSLAT
WHERE STRIPED='something';
>

Since this cannot use an index you will have a table scan. Likewise,
"containing" will not use index. If a table scan is fast enough you can
use an SP to StripUnnecessaryChars. I'm not sure you can (currently) use
the field alias in the WHERE clause.
An alternative could be to store a fixed-up string in another field - you
wouldn't have to use the SP. Further, you might store fixed-up "words" in
a separate table - more work, but you might be able to use an index on
that table to speed up retrieval.


--
Aage J.