Product Documentation

c-treeACE V10.0 Update Guide

Previous Topic

Next Topic

Data Filters

The data filter capability implemented with the SetDataFilter() function allows developers to access a qualified set of records specified by a conditional statement. Unlike the conditional index expressions, which become a permanent part of the index definition (except for temporary indexes), a specific filter is a “run-time” feature and remains active until you change filter definitions or the data file is closed. Further, a specific filter only applies to the calling user: it does not affect the retrieval of records by other users.

Filtering lets you specify criteria to temporarily restrict access only to records that meet the filter criteria. c-treeACE filters in client/server environment may substantially reduce network traffic since only the records that satisfy the filter condition will be returned. ISAM-level record requests, including sets and batches, skip over records failing the filter transparently to the user. In client/server, this may substantially reduce network traffic since only the records that satisfy the filter will be returned. For example, with a data file of 1,000 records, if a filter excludes 900 of the records, a FirstRecord() - NextRecord() loop results in only 100 calls to the c-treeACE Server, not 1,000 calls. Generally, an index can also be used to help reduce unnecessary record retrievals, however, the filter allows for as-needed retrievals.

With the SetDataFilter() function, record returns, such as from FirstRecord() or GetRecord(), can be limited to a specific range. The conditional expressions, in conjunction with the schema map and symbolic field names, describe the range of values returned. For example, the expression “(ZipCode >= 65000) && (ZipCode < 66000)” would limit returns to records with 65xxx ZipCodes. While there is a limit of one expression, the expressions can be as complex as necessary to accomplish your goals.

Data Filters

For partitioned files, call SetDataFilter() for the host data file and the filter automatically applies to each partition member file. See SetDataFilter() for additional details.

In This Section

Data Filter Stacks - Support Multiple Data Record Filters per File

Conditional Expression Support Enhanced

Filter Callback Support Enhanced

TOCIndex