FIND-FIRST( ) methodGets a single record. This method lets a user get the first record that satisfies the predicate expression.
Return type:
Applies to:
FIND-FIRST ( predicate-expression , lockmode , wait-mode )
logical-expression USE-INDEX index-nameWHEREOnce evaluated, predicate-expression can contain only constants and unabbreviated references to fields from the buffer.The predicate-expression itself can be built using a concatenation of character expressions.An integer expression evaluating to one of the following constants: SHARE-LOCK, EXCLUSIVE-LOCK, or NO-LOCK. You can assign any of these constants to an integer variable. For example, mylock = NO-LOCK.An integer expression evaluating to one of the following: NO-WAIT, 0, or the Unknown value (?). You can assign NO-WAIT to an integer variable. For example, mywait = NO-WAIT. The default is to wait.
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 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.
© 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |