PreviousNextIndex

GET statement

Returns one record for a previously opened query.

Syntax

GET { FIRST | NEXT | PREV | LAST | CURRENT } query 
    [ SHARE-LOCK | EXCLUSIVE-LOCK | NO-LOCK ] 
    [ NO-WAIT ] 

FIRST query
NEXT query
PREV query
LAST query
CURRENT query
SHARE-LOCK
EXCLUSIVE-LOCK
NO-LOCK
NO-WAIT
Example

This procedure uses the GET statement to find Customer orders:

r-getord.p
DEFINE QUERY cust-order FOR Customer, Order. 
OPEN QUERY cust-order FOR EACH Customer, EACH Order OF Customer. 
GET FIRST cust-order. 
DO WHILE AVAILABLE Customer: 
  DISPLAY Customer.CustNum Customer.Name  
    WITH FRAME cust-info. 
  DISPLAY Order WITH FRAME order-info SIDE-LABELS. 
  PAUSE. 
  GET NEXT cust-order. 
END. 

In the example, the GET FIRST statement fetches the first Customer record and the first Order record for that Customer. The GET NEXT statement fetches the next Order record for the Customer. If no more Order records are found for the current Customer, then the GET NEXT statement fetches the next Customer and the first Order record for that Customer. If a Customer has no Orders, the GET statement skips that Customer.

Notes
See also

AVAILABLE function, CLOSE QUERY statement, CURRENT-CHANGED function, CURRENT-RESULT-ROW function, DEFINE QUERY statement, FIND statement, FOR statement, LOCKED function, NUM-RESULTS function, OPEN QUERY statement, QUERY-OFF-END function, REPOSITION statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex