range where


The range where statement allows you to apply additional restrictions to a range of records in a table. This statement is available only for SQL tables.


range table table_name where selection_criteria


table table_name – The table to which additional selection criteria is being applied.

selection_criteria – A string containing the additional restrictions to apply to the current range. This string should use syntax similar to a SQL “WHERE” clause. Selection criteria can be applied to any column in the table. You may want to use the physicalname() function to retrieve physical names for table columns used in the selection criteria, rather than hard-coding them into the script.


In Dexterity-based applications, it’s common to read a range of records and discard the records that aren’t needed. For example, in scrolling windows, the reject record statement is used to throw away records that shouldn’t be displayed. Because read operations are fast for c-tree and Pervasive.SQL, this is an acceptible design approach. Read operations for SQL Server are much slower, so this approach is inefficient. The range where statement can be used to apply additional selection criteria to a range, further narrowing the range of records selected.

The selection criteria added by the range where statement is in addition to any other range criteria applied by the range statement. To remove the additional selection criteria for the range, issue the range where statement with the empty string ("") as the selection criteria. The range clear statement will also remove the additional selection criteria.

Because this statement is available only for SQL tables, you will need to have two sets of code. One set will support SQL tables, and the other will support c-tree and Pervasive.SQL tables.

Documentation Feedback