Feature request : extend the filter behaviour ( NOT keyword)

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Feature request : extend the filter behaviour ( NOT keyword)

Post by swierzbicki » Tue 27 May 2008 19:25

Hi,

The filtering is working when the filter is filled with something like this :

Code: Select all

User like ‘root’
The filtering is no more working when the filter is filled with something like this :

Code: Select all

User not like ‘root’
I know that I've already asked you for this... but right now I can't use the workarrounds you told me
- using the filter thids way

Code: Select all

 NOT User LIKE  ‘root’ 
- using the filterSQL property : I'm using a cxgrid that automatically fill the filter property.

jkuiper_them
Posts: 28
Joined: Thu 20 Dec 2007 14:48

Post by jkuiper_them » Wed 28 May 2008 07:52

Why not rephrase your sql with the option SQLWHERE instead of filters :?:

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Wed 28 May 2008 14:13

Hi jkuiper_them,
Why not rephrase your sql with the option SQLWHERE instead of filters Question
This will works with simple SQL statements like 'Select * from Table'.
In my case, I'm joining differents tables. These tables are sometimes sharing the same fieldname (used for joining). The generated filter expression doesn't know anything from the underlaying table so I can't take it and used it as an SQLFilter.

Exemple 1 :
MySQL TableA : IdA , Reference, CustId...
MySQL TableB : CustId, Name, Street....

Code: Select all

TmyQuery SQL Statement : Select  TableA.reference,TableA.CustId,TableB.Name from tableA inner join tableB on (tableA.custid = table2.custid)
TMyQuery will retreive fields Reference,CustId,Name
In my cxgrid, I set a filter on the CustId column. The cxgrid will generate a filter expression like this CusId = 1233.

I can't fill the SQLFilter with the generated filter expression. I will get an exception (and that's right) about ambigious CustId field....

Exemple 2 :
MySQL TableA : Id,ValueA,ValueB,ValueC

Code: Select all

TmyQuery SQL Statement : Select  ID, (ValueA+ValueB)/ValueC as) ExpressionA
TMyQuery will retreive fields ID,ExpressionA
In my cxgrid, I set a filter on the ExpressionA column. The cxgrid will generate a filter expression like this ExpressionA= 27.56

I can't fill the SQLFilter with the generated filter expression. I will get an exception (and that's right) about an non existant field


Exemple 3 :
MySQL TableA : Id,ValueA,ValueB,ValueC

Code: Select all

TmyQuery SQL Statement : Select  ID, ValueA,ValueB,ValueC
TMyQuery will retreive fields ID,ExpressionA. Add all persistent fields + create an calculated field....

In my cxgrid, I set a filter on the Calculated column. The cxgrid will generate a filter expression like this Calculeted = 27.56

I can't fill the SQLFilter with the generated filter expression. I will get an exception (and that's right) about an non existant field

Post Reply