Check Count Query

Previous Next

Prevent queries from fetching too many records.

Background

You can limit the number of records to be fetched by a single query by setting the Check Count Query property to Yes (default No), and then setting Max No of Records to Fetch to the maximum.

The check is performed by issuing a SELECT COUNT(*) statement that meets the query conditions to the database before the actual query is send. If the resulting number of records is higher than the allowed maximum, an error message will appear:

"This query will retrieve too many rows. Please refine your search.

The maximum number of rows is <number>".

When to use

Setting the Check Count Query property to Yes is useful if you do not want the user to execute queries that will result in too many fetched records.

To prevent a query from fetching too much records:

1.Use the Class Catalog to select and open the appropriate window.
2.Open the Property Inspector, and click the General tab page.
3.Change the Check Count Query property to Yes.
4.Change the Max No of Records to Fetch property to the maximum.
5.Save your changes.

NOTE: If you set the Max No of Records to fetch property to 0 (zero), the entire table is fetched (that is, unlimited).