EPUB | CHM | PDF

TMySQLDataSet.Properties.Filter

Top Previous Next

Specifies the text of the current filter for a dataset.

Syntax:

property Filter: String;

Description:

Use Filter to specify a dataset filter. When filtering is applied to a dataset, only those records that meet a filter's conditions are available to an application. Filter contains the string that describes the filter condition.

For example, the following filter condition displays only those records where the State field is 'CA' or 'MA':

State = 'CA' or State = 'MA'

Since DAC for MySQL v2.6.3 Filter property supports extended syntax:

LIKE operator support.

Sets of characters inside square brackets, e.g. [azAz], [a-dA-D].

Exclamation sign (!) inside set indicates that any character should be matched except for those in set.

Wildcard '%' matches any number of characters.

A question mark '?' matches a single arbitrary character.

For example:

State LIKE '[mt]%' - will give us Montana, Texas, Michigan etc.
State LIKE '[!mt]%' - will give us all except states where first letter is 'm' or 't'

note Applications can set Filter at runtime to change the filtering condition for a dataset at (for example, in response to user input).