|Visual FoxPro 9.0 SP2|
Included for backward compatibility. Use UPDATE - SQL instead.
This command is undocumented in the original VFP9 help file,
but the following documentation was found in the FoxPro for Windows 2.6 help, and may still be valid:
Updates the table open in the currently selected work area with data from another table open in another work area.
UPDATE ON field FROM file REPLACE field1 WITH expr1 [, field2 WITH expr2 ...] [RANDOM]
To use UPDATE, the current table and the table you update from must have a common field. field specifies the common field that controls the update. The current table must be indexed or sorted in ascending order on the common field. Update performance is improved if the update table is also sorted or indexed.
The table open in the currently selected work area is updated with data from a table open in another work area. Specify the name of the table open in the other work area with file.
REPLACE field1 WITH expr1 ...
Issuing UPDATE replaces a field (field1) in the current table with an update expression (expr1). You can update more than one field in the current table by including a list of fields (field2, field3, and so on) and corresponding update expressions (expr2, expr3, and so on).
The update expressions are usually the names of fields from the update table. They can also be general expressions or constants.
Note that for each record in the current table, there can be multiple matching records in the update table. If there are multiple matching records, the record in the current table is updated by each of the matching records. If the current table contains identical key field records, only the first of the matching records is updated.
You must include the RANDOM keyword if the update table isn't indexed or sorted in ascending order.
Important An incorrect number of records might be updated if the update table isn't indexed or sorted in ascending order and RANDOM isn't included.
Comment or report problem with topic