TZQuery.Filter problems

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
time2fly
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 19.03.2014, 22:28

TZQuery.Filter problems

Post by time2fly »

Problem 1:
This filter works: fieldname like "value*"
This filter does not work: fieldname like "*value*"

What am I doing wrong here?

Problem 2:
I have the following sql loaded in the TzQuery:
SELECT.. table1.name, table2.name,.. FROM ... INNER JOIN table1.. table2
Works fine, but when I add a filter of the following form, the "." is not accepted:
Filter: (table1.name like "value*") OR (table2.name like "value*")

How can I define a filert with redundant field names?
time2fly
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 19.03.2014, 22:28

Re: TZQuery.Filter problems

Post by time2fly »

:( Can nobody help me? Am I the only one with these filter problems?
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Re: TZQuery.Filter problems

Post by mdaems »

Without deeper study I can't answer your first question. But try debugging the IsMatch function in core\ZMatchPattern.pas.

For the second question: filters never become part of the query statement, so sql syntax doesn't work. You should give the result columns of your queries a unique name like
SELECT.. table1.name as name1, table2.name as name2,.. FROM ... INNER JOIN table1.. table2
Then your filter can reference the field names name1 and name2.

Mark
Image
Post Reply