PreviousNextIndex

FIND-FIRST( ) method

Gets a single record. This method lets a user get the first record that satisfies the predicate expression.

Return type: LOGICAL

Applies to: Buffer object handle

Syntax
FIND-FIRST (predicate-expression [ , lockmode [ , wait-mode ] ] ) 

predicate-expression
lockmode
wait-mode

The following shows some examples of FIND-FIRST method:

DEFINE VARIABLE bh     AS HANDLE    NO-UNDO. 
DEFINE VARIABLE myname AS CHARACTER NO-UNDO. 
bh = BUFFER Customer:HANDLE. 
bh:FIND-FIRST("WHERE Customer.CustNum > 2", NO-LOCK). 
DO TRANSACTION: 
  bh:FIND-FIRST("", EXCLUSIVE-LOCK). 
END. 
bh:FIND-FIRST("WHERE Customer.Name = " + QUOTER(myname) , NO-LOCK). 

If FIND-FIRST succeeds, it returns TRUE, otherwise it returns FALSE.

If FIND-FIRST fails, it does not raise an error but displays a message. You can suppress this message by using NO-ERROR on the statement containing the method.

See also: FIND-BY-ROWID( ) method, FIND-CURRENT( ) method, FIND-LAST( ) method, FIND-UNIQUE( ) method, FIND statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex