Command UPDATE Foundation
Updates data in the current work area using data from another work area.
UPDATE FROM <cAlias> ON <cKeyExpr> [RANDOM] ;
REPLACE <cFieldname1> WITH <Expression1> ;
[, <cFieldname2> WITH <Expression2>...]
The command UPDATE updates the records in the current work area using values from the records of a second work area <cAlias>. An update only occurs when the expression <cKeyExpr> provides the same value in both work areas. This assumes that a controlling index with the index expression <cKeyExpr> is active and that no multiple key values exist in this index. The records of the second work area are processed sequentially and the value of <cKeyExpr> of the second work area is searched for in the current work area using SEEK. If a matching record is found, the fields specified in the list <Fieldname1> to <cFieldnameN> are updated with the values from <Expression1> to <ExpressionN>.
When the option RANDOM is specified, the records of the second work area can appear in any order. This requires more time for the update. If RANDOM is not specified, the records of the second work area must be sorted (logically or physically) in the order defined by <cKeyExpr>.
If records in either of the two work areas are marked for deletion, they are ignored if SET DELETED is set to ON. As long as SET DELETED is OFF, all records are considered and they retain their "Deleted" status.
If the command UPDATE is used in a multi-user application in network operation, the file in the current work area must be locked or opened exclusively. The file in the second work area does not need to be locked since only read access of it occurs.
The functional equivalent of UPDATE is the function DbUpdate().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.