Board index » delphi » How to make InterBAse query case insensitive?

How to make InterBAse query case insensitive?

H have a query in Delphi where I query a table in an InterBase
database using the LIKE keyword, i. e. LIKE "%KEY%". How do I make
this query case _in_sensitive, as it is now, it is case sensitive, and
that does work for my users.

CUL8R dude!                       \|/
                                  @ @
Jens  +-----------------------oOO-(_)-OOo-----------------------+
      | Internet   jb...@image.dk     Fax     +45 - 3537 - 7006 |
      +---------------------------------------------------------+

 

Re:How to make InterBAse query case insensitive?


Try this:

SELECT * FROM <table> WHERE UPPER(<name_of_the_field>) LIKE "%KEY%"

This way, any character (lowercase or uppercase) will be seen as
uppercase, making the query case insensitive.

I hope this helps.

--
Elifarley C. Coelho
Belo Horizonte -MG
Brazil

Quote
>H have a query in Delphi where I query a table in an InterBase
>database using the LIKE keyword, i. e. LIKE "%KEY%". How do I make
>this query case _in_sensitive, as it is now, it is case sensitive, and
>that does work for my users.

>CUL8R dude!                       \|/
>                                  @ @
>Jens  +-----------------------oOO-(_)-OOo-----------------------+
>      | Internet   jb...@image.dk     Fax     +45 - 3537 - 7006 |
>      +---------------------------------------------------------+

Re:How to make InterBAse query case insensitive?


In article <fc.004c4f740010b1253b9aca00395bd3ec.10b...@delphi.com.br>,
  Elifarley_Coe...@delphi.com.br (Elifarley Coelho) wrote:

Quote
> Try this:

> SELECT * FROM <table> WHERE UPPER(<name_of_the_field>) LIKE "%KEY%"

> This way, any character (lowercase or uppercase) will be seen as
> uppercase, making the query case insensitive.

> I hope this helps.

It didn't. When I try to run the query I get an exception stating that "The
table is readonly".

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:How to make InterBAse query case insensitive?


Quote
On Fri, 11 Sep 1998 08:26:44, jb...@dk-teknik.dk wrote:
> In article <fc.004c4f740010b1253b9aca00395bd3ec.10b...@delphi.com.br>,
>   Elifarley_Coe...@delphi.com.br (Elifarley Coelho) wrote:
> > Try this:

> > SELECT * FROM <table> WHERE UPPER(<name_of_the_field>) LIKE "%KEY%"

> > This way, any character (lowercase or uppercase) will be seen as
> > uppercase, making the query case insensitive.

> > I hope this helps.

> It didn't. When I try to run the query I get an exception stating that "The
> table is readonly".

Set the TQuery's RequestLive property to false. IIRC, you cannot edit
TQueries with the 'like' operator.

-----------------------------------------
Simon Thompson
Christchurch
New Zealand

Other Threads