Tutorial by Examples

A simple sports2000 example: FIND FIRST Customer NO-LOCK WHERE CustNum = 1 NO-ERROR. IF AVAILABLE Customer THEN DO: DISPLAY Customer.NAME. END. ELSE DO: MESSAGE "No record available". END. FIRST - find the first record that matches the query NO-LOCK - don't lock the r...
The latest find is always the one the availability check will work against - a unsuccesful find will make AVAILABLE return false: DEFINE TEMP-TABLE tt NO-UNDO FIELD nr AS INTEGER. CREATE tt. tt.nr = 1. CREATE tt. tt.nr = 2. CREATE tt. tt.nr = 3. DISPLAY AVAILABL tt. // yes (tt w...
Whenever you FIND a record you can aquire a lock of it. NO-LOCK: Used for read only operations. If you do a FIND <record> NO-LOCK you cannot in any way modify the record. FIND FIRST Customer NO-LOCK NO-ERROR. EXCLUSIVE-LOCK: Used for updates and deletes. If you do this you will "own&...

Page 1 of 1