Subject Re: [firebird-support] Re: Is such a CASE WHEN usage allowed?
Author Kjell Rilbe
Svein Erling Tysv�r skriver:
>
> > POSITION(sep || soughtval || sep in sep || searchedvaluelist || sep) > 0
> >
> > Adding sep before and after each string makes sure you don't get
> false hits, like '12'
> > in '341256,234,567' where '12' appears inside '341256', but ',12,'
> doesn't.
>
> Good idea, Kjell, but then why not use CONTAINING as an alternative to
> POSITION?
>
> sep || searchedvaluelist || sep CONTAINING sep || soughtval || sep
>

Yes, obviously. I forgot about that one. :-)

Anyway, I've used this technique many many times in regular Delphi code.
Not so often in C#, probably because it has string.split() etc.

Kjell

--
------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64



[Non-text portions of this message have been removed]