Filter property problem

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
almi
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.10.2010, 12:23

Filter property problem

Post by almi »

Hi,

Context :
Delphi 2007 + MySql 4.1 (Connection protocol : mysql-4.1)

I have one aliased request (see sample) :

SELECT A.field1, A.field2, B.Field1, B.Field2 FROM TableA As A inner join TableB As B on A.KeyField = B.foreignField

If i add this filter : A.field3 like 'my criteria%'

The Filter assignation crash with this message : Unknow symbol ''.''

Witch solution do you have for this problem ?

Best regard,
guidoaerts
Senior Boarder
Senior Boarder
Posts: 93
Joined: 01.07.2009, 16:07

Post by guidoaerts »

you can only filter on fields in the resultset, so add A.field3 to your select ;
or add a WHERE clause to your sql
Guido
almi
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 13.10.2010, 12:23

Post by almi »

Ok Guido,

Tank for your answer but my problem is not solved with your information.
I have the same result error.

The problem seems to stem from the query using aliases.

Alain
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

No Almi,

The problems is that you are confusing the filer with a sql 'where' clause.
In a filter the columns should be named the way they are named in the resultset. This means as 'field3' when the field is included in the select. Anther thing to remember is that the like is a special operator in a filter which behaves like this (from a text by Guy Fink):
The LIKE-Operator calls the pattern matching function IsMatch.
Examples from the source file :
IsMatch allows unix grep-like pattern comparisons, for instance:
? Matches any single characer
* Matches any contiguous characters
[abc] Matches a or b or c at that position
[^abc] Matches anything but a or b or c at that position
[!abc] Ditto
[a-e] Matches a through e at that position
'ma?ch.*' -Would match match.exe, mavch.dat, march.on, etc
'this [e-n]s a [!zy]est' - Would match 'this is a test',
but would not match 'this as a yest'
Mark
Image
Post Reply