GET-FIRST( ) method
- Last Updated: February 11, 2026
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
Moves a query object's result list pointer to the first row.
Return type: LOGICAL
Applies to: Query object handle
Syntax
|
- NO-LOCK
- Specifies that no lock is applied to the record. This applies to all buffers in a join. Unless explicitly specified otherwise, this is the default lock type for this method.
- SHARE-LOCK
- Specifies that the record is share locked. This applies to all buffers in a join.
- EXCLUSIVE-LOCK
- Specifies that the record is exclusively locked. This applies to all buffers in a join.
- NO-WAIT
- Specifies that the method returns immediately if the record cannot be
accessed because it is locked by another user. If you do not use the
NO-WAIToption, the method waits until the record can be accessed. This applies to all buffers in a join. If you specifyNO-WAITand the record is locked by another user, the record is returned to you withNO-LOCKand theLOCKEDfunction returns TRUE for the record.
Example
|
Notes
GET-FIRST()returns TRUE if the first record in the query is found. If the query is not open or the first record cannot be found (query is empty), the method returns FALSE. If the query object handle is invalid, an error is raised.- A query that includes a
BREAK BYphrase becomes aFORWARD-ONLYquery. In this case you cannot use theGET-FIRST()method. If you do, the AVM raises ERROR. - When you execute an
OPEN QUERYorREPOSITIONstatement for a query associated with a browse widget, the browse is automatically adjusted to remain in sync with the query. However, when you execute aGETstatement or method, the browse is not adjusted. You can use theGETstatement, or one of theGETmethods (GET-CURRENT/FIRST/LAST/NEXT/PREV) to perform background processing without affecting the browse, but you must execute aREPOSITIONstatement or one of theREPOSITIONmethods (REPOSITION-BACKWARD/FORWARD/TO-ROW/TO-ROWID) to put the query and browse back in sync. GET-NEXT()does the same action asGET-FIRST()if it is the firstGETcall after a query is opened.