Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : Database Access : Fetching field lists : Specifying field lists in ABL : Queries versus record selection blocks
 
Queries versus record selection blocks
For a query, you must specify the field lists in the DEFINE QUERY statement, not the Record Phrase of the OPEN QUERY statement. Thus, the following two procedures, i-fldls1.p and i-fldls2.p, are functionally equivalent.
i-fldls1.p
DEFINE QUERY custq FOR Customer FIELDS(Name CustNum Balance).
OPEN QUERY custq PRESELECT EACH Customer.
REPEAT:
  GET NEXT custq.
  IF AVAILABLE(Customer) THEN
    DISPLAY Customer.Name Customer.CustNum Customer.Balance.
  ELSE LEAVE.
END.
i-rldls2.p
REPEAT PRESELECT EACH Customer FIELDS (Name CustNum Balance):
  FIND NEXT Customer.
  DISPLAY Customer.Name Customer.CustNum Customer.Balance.
END.