Board index » delphi » Using case insensitive SQL strings in delphi 2.0 C/S

Using case insensitive SQL strings in delphi 2.0 C/S

Hi all,

the following SQL-Statement doesn't work properly:

Select * from <tablename> where <fieldname> like 'Country%'

example for the table contents:

        Country
        country
        COUNTRY

The Query returns only one of those recordsets.
Is it possible to use a case insensitive query-string?
With MSAccess no problem... but delphi ? I can't believe that!

I'm looking forward to your early reply

Thanks in advance

PS: We are using Delphi 2.0 C/S with local BDE and DBase IV-Tables

 

Re:Using case insensitive SQL strings in delphi 2.0 C/S


Quote
Alexander Vo wrote:

> Hi all,

> the following SQL-Statement doesn't work properly:

> Select * from <tablename> where <fieldname> like 'Country%'

> example for the table contents:

>         Country
>         country
>         COUNTRY

> The Query returns only one of those recordsets.
> Is it possible to use a case insensitive query-string?
> With MSAccess no problem... but delphi ? I can't believe that!

> I'm looking forward to your early reply

> Thanks in advance

> PS: We are using Delphi 2.0 C/S with local BDE and DBase IV-Tables

You can use:
Select * from <tablename> where
lower(<fieldname>) LIKE lower(<keystring>)

Atle Markeng
DataMar, Oslo-Norway

Re:Using case insensitive SQL strings in delphi 2.0 C/S


Quote
02131109-0...@t-online.de (Alexander Vo) wrote:
>Hi all,
>the following SQL-Statement doesn't work properly:
>Select * from <tablename> where <fieldname> like 'Country%'
>example for the table contents:
>    Country
>    country
>    COUNTRY
>The Query returns only one of those recordsets.
>Is it possible to use a case insensitive query-string?
>With MSAccess no problem... but delphi ? I can't believe that!

This is a database issue, not a programming language issue.  If the
database that you are using supports this feature then you can use it,
if it doesn't then you can't.  Delphi has nothing to do with this.
-------------------------------
Thomas Paul
TOMG...@Pipeline.Com
Dean Witter, Discover & Co.
New York City, NY USA
----------------------------------

Re:Using case insensitive SQL strings in delphi 2.0 C/S


Quote
02131109-0...@t-online.de (Alexander Vo) wrote:
>Hi all,
>the following SQL-Statement doesn't work properly:
>Select * from <tablename> where <fieldname> like 'Country%'
>example for the table contents:
>    Country
>    country
>    COUNTRY
>The Query returns only one of those recordsets.
>Is it possible to use a case insensitive query-string?
>With MSAccess no problem... but delphi ? I can't believe that!
>I'm looking forward to your early reply
>Thanks in advance
>PS: We are using Delphi 2.0 C/S with local BDE and DBase IV-Tables

hello.

one get-around solution is to use the sql in this manner:

select * from <tablename> where upper(<fieldname>) like
upper(<comparison field>)

works for me :)

Other Threads