[SQL]How to make LIKE '%x%' case-sensitive? 
Author Message
 [SQL]How to make LIKE '%x%' case-sensitive?

Hi.

When a SQL property of TQuery is set to:
SELECT Name FROM 'Person.Db'
        WHERE Name LIKE '%x%';

Delphi 2 lists only those with Name containing lower-case 'x'.
But Delphi 1 lists all with Name containing BOTH lower-case AND
upper-case, which is not intended.

Is there a way to make 'LIKE' case-sensitive?

Happy Coding!

(P.S. Forgive my poor English... Any correction is welcome!)



Tue, 19 Oct 1999 03:00:00 GMT
 [SQL]How to make LIKE '%x%' case-sensitive?

Quote:

> Hi.

> When a SQL property of TQuery is set to:
> SELECT Name FROM 'Person.Db'
>         WHERE Name LIKE '%x%';

> Delphi 2 lists only those with Name containing lower-case 'x'.
> But Delphi 1 lists all with Name containing BOTH lower-case AND
> upper-case, which is not intended.

> Is there a way to make 'LIKE' case-sensitive?

> Happy Coding!

> (P.S. Forgive my poor English... Any correction is welcome!)

This is more of a function of the Server back end.  I have used
Interbase, Informix, Sybase, Oracle, and MSSQL.  They all work
differently.  

If you are using Paradox tables (or do we say 'BDE' tables), try
creating a case-sensitive index on the field you are querying, use it,
and see if that works.

--
--------------------------------------------
In theory, theory and practice are the same.
In practice, they are not.
--------------------------------------------
Bryan Valencia
Software Services - Making Windows Scream
WWW   : www.invsn.com/softserv/

--------------------------------------------



Tue, 19 Oct 1999 03:00:00 GMT
 [SQL]How to make LIKE '%x%' case-sensitive?

Quote:

> If you are using Paradox tables (or do we say 'BDE' tables), try
> creating a case-sensitive index on the field you are querying, use it,
> and see if that works.

Bryan,

If I may ask a related question:

I've seen various references to the fact that SQL queries against local
tables do not use indexes to achieve optimization.  I've seen two
allusions to the fact that SetRange is optimized, but SQL queries are
not.

As someone considering moving to Delphi from FoxPro, this is a bit
disconcerting.  (FoxPro queries *do* use indexes to achieve
optimization.)

Wondering if you (or anyone) could shed some additional light on this.
(I am most interested in Delphi 3, in case in contains improved query
support.)

Many thanks.



Fri, 22 Oct 1999 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Case Sensitive Join on non case-sensitive sql server

2. Microsoft SQL Server Password to be made Case Sensitive

3. ADO Find method don't catch case-sensitive

4. Case Sensitive and not so Case Sensitive

5. Making Replace Case sensitive

6. Making user names NOT case sensitive

7. Question on Scope of Case-Sensitivity on a Case-Sensitive SQL Server 7.0/2000

8. case-sensitive or case-insensitive: which is better in SQL 7

9. SQL Server case sensitive or case insensitive.

10. What makes a stored procedure 'INVALID'?

11. Making a user 'read only'

12. Making 'Empty'clients with developer?


 
Powered by phpBB® Forum Software