Icon View Incident Report

Serious Serious
Reported By: Barney Tyrwhitt-Drak
Reported On: 9/23/1999
For: Version 1.16 Build 1
# 468 Using "%" With LIKE Operator in SQL WHERE Clause Causes Incorrect Results To Be Returned

I've come across an abnormality when doing wild card searches using DBISAM 1.15 in Delphi 4. The underlying table has the No Partial Comparisons checkbox unchecked. The SQL being generated has expressions like (SURNAME LIKE :Name2) in the WHERE clause. The Name2 parameter is being set with text that always includes the standard SQL wild cards of % and
_ if the LIKE operator is being used. If I run a query with a Name2 parameter set to A%, the TDBISAMQuery correctly returns all records beginning with the letter A in the SURNAME field. If the wild card comes first such as a parameter of %Z% this will
correctly retrieve all records with the letter Z somewhere in the surname field. However, if I put the % wildcard on its own as the
parameter, instead of getting all the records returned, I get none. In the same conditions the BDE would return all records. However, if I put %% in as the parameter it correctly returns all records that have text in that field. If I put the _ in as a single character in the parameter it correctly returns all one lettered surname entries. It just seems to be the % on its own that is behaving oddly.


Resolution Resolution
Fixed Problem on 10/9/1999 in version 1.17 build 1
Image