UPDATE’RECORD

UPDATE’RECORD #channel, varlist

This statement rewrites a previously locked record and updates all indexes accordingly.

The recno variable (from the OPEN statement) determines which record will be updated. Normally it is set automatically by a GET operation with the LOCKED option. However, it could also be set manually, or via an ISAM'POP statement.

Because failed GET and NEXT operations do not update the recno variable, you should always check the value of the status variable after these operations to avoid inadvertently updating the wrong record.

If the record specified by the recno value is not currently locked, the attempted UPDATE'RECORD will generate BASIC error 42 (record not locked).

UPDATE'RECORD does not release the lock on the record. So normally you would follow it with a RELEASE'RECORD operation.

The UPDATE'RECORD operation performs all necessary index operations so that the indexes match the updated data.

All errors trap (as BASIC errors).

Update Note: Build 899.1.4 of 09 Sept 04

The UPDATE'RECORD statement now generates a Basic error #231 instead of merely returning status -3 when there is an error in updating one of the index files. This could potentially interrupt programs which were already checking for this condition, but given that a similar error in the GET statement generates the same error, and that it is highly unlikely that there is any appropriate response to such a condition other than rebuilding/verifying the index(es), it seems appropriate to generate a Basic error here (that can't be ignored).