Progress
Language Tutorial
for Character


Sorting Records

This is the syntax for using the OPEN QUERY statement’s sorting options.

SYNTAX
OPEN QUERY query FOR EACH record-phrase
  [ BY expression [ DESCENDING ] ] ...
  record-name [ USE-INDEX index ] 

Table 9–2 describes the sorting options.

Table 9–2: Record Sorting Options 
Component
Description
BY expression
Specifies an expression to use as the basis for sorting the selected records. The FIND statement does not support BY.
ASCENDING
DESCENDING
Ascending sorts begin with the lowest value and go to the highest value (A, B, C, D). Descending sorts start with the highest value and go toward the lowest value (Z, X, Y, W). By default, sorting is always ascending, so you don’t need to specify the ASCENDING keyword. To use descending order, you must specify the DESCENDING keyword in the BY phrase.
USE-INDEX
Forces Progress to sort the selected records using a defined index.


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