Subject | Re: case insensitive "where" clause |
---|---|
Author | bwc3068 |
Post date | 2009-06-27T23:01:39Z |
Thanks for the replies!
Is it just as simple as...when I want to do the case insensitive query, i change the TIB_Connection.CharSet to ISO8859.1 and do the query then change it back to whatever it was (it's actually nothing right now)?
I'm not exactly sure how to use that character set for what I need....thanks!
and it sounds like the upper(field) won't really effect the speed of the result. Cool.
thanks again
kelly
Is it just as simple as...when I want to do the case insensitive query, i change the TIB_Connection.CharSet to ISO8859.1 and do the query then change it back to whatever it was (it's actually nothing right now)?
I'm not exactly sure how to use that character set for what I need....thanks!
and it sounds like the upper(field) won't really effect the speed of the result. Cool.
thanks again
kelly
--- In firebird-support@yahoogroups.com, Alexandre Benson Smith <iblist@...> wrote:
>
> bwc3068 wrote:
> > Hi--
> >
> > A simple question on making my where clauses case insensitive with FB 2.nn.
> >
> > is there an easier way then setting up the SQL like the below?
> >
> > select * from table
> > where
> > upper(field) like '%UPPERCASE LOOK FOR%'
> > order by
> > upper(field)
> >
>
> use a case insensitive collation such as PT_BR for ISO8859_1 charset
>
> > is there a speed issue?
>
> if you have a expression index on UPPER(Column) then it would be ok, it
> you don't have such an index FB would use a naturl table scan, wich
> could be slow in large tables
>
> > that is...will that resolve as fast as:
> >
> > select * from table
> > where
> > field like '%LOOK FOR%'
> > order by
> > field
> >
>
> It will be as fast (or better as slow), because both would not use an index.
>
> > thanks again!
> > regards
> > kelly
> >
>
> see you !
>
> --
> Alexandre Benson Smith
> Development
> THOR Software e Comercial Ltda
> Santo Andre - Sao Paulo - Brazil
> www.thorsoftware.com.br
>