Progress
Language Tutorial
for Character


Selecting Records

Record selection is the process of distinguishing which records are part of the set you want to work with and which are not. In a defined query, the results list represents the set of records you want to work with. With the results list established, you can ignore all the other records in the table. For example, you might want to select just those customers who have a balance due, or those items that are on order. This section describes the two main options for selecting records.

As a refresher, this is the basic syntax for the OPEN QUERY statement.

SYNTAX
OPEN QUERY query-name FOR EACH record-phrase 

This syntax diagram shows a partial syntax for the record phrase, listing the selection options.

SYNTAX
record-name 
  [ WHERE expression ]
  [ USING [ FRAME frame ] field 
    [ AND [ FRAME frame ] field ] ...
  ] 

Table 9–1 introduces the record phrase selection options.

Table 9–1: Record Selection Options 
Component
Description
record-name
The table name.
WHERE
Specifies an expression to use as record-selection criteria. For example, WHERE Cust-Num < 11 finds all the customers with a customer number of less than 11. You saw many examples of WHERE expressions in Chapters 5 and 6.
USING
Specifies a screen value to use as the selection criteria. For example, you can have the user enter a region name, and then use that data to create a list of all the customers from that region.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095