Forum > Database

TBufDataset.Filter := 'FieldName Is Null' does not work.

<< < (2/2)

Yes it is there in Delphi documentation specified under

* For IBX.IBTable.TIBTableIt is not clear, but from context I assume that construct IS NULL is for IBX components only.

Later is

* For Data.DB.TDataSetand examples for TADODataset shows:
 State <> 'CA' or State = NULL

Another documentation shows
 State <> CA or State = BLANK

So we have 3 various construct:

* is null
* =null
* =blank

I played with Delphi's ClientDataset which corresponds to our TBufDataset - see attached demo project: Open the .dproj file with Delphi (I am using 10.3.3 Community Edition), and the empty records are filtered with the syntax "<fieldname> IS NULL" or "NOT <fieldname> IS NULL". The attachment contains also a Lazarus version of the same project (Open the .lpi file in Lazarus), and here the programs crashes when these filters are activated.

I investigated how Filter works in TBufDataset .
Local filtering relies on TDbf code and there is no such things as NULL handling.
Simply: involved object such as TConstant, TVariable are not NULL aware.
They expects that field has value which is assigned to their native type (integer, string, double).


[0] Message Index

[*] Previous page

Go to full version