TBLT_RETC TBLT_ENTRY BltIx4Update(TBLT_KH *khPtr, VOID *keyBufferPtr, ULONG recNo, VOID *newRecPtr, ULONG *actionPtr); khPtr I:index file control structure keyBufferPtr O:new key stored (if different) recNo I:recNo of record to update recordPtr I:updated record data actionPtr O:action takenThis routine updates (if needed) the data record identified by recNo, builds a key for it (if needed), and stores that key and recNo into the index file (if needed) (not physically in that order).
A single index file and a single data file are accessed. To perform more
complex updates see BltIx4UpdateEx()
.
After a successful update, where the key has changed (action=3), the index
position is set to the new key. FLAGS_ATOMIC_BIT
can be set to
restart at the previous, or any, position (see BltIx4GetNext()
).
If the key store operation failed, for whatever reason, the data record update operation that preceded it will be backed out automatically, thereby restoring the database to its original state.
ActionPtr is set to one of the following values:
0 = nothing done (error encountered) 1 = updated data record only (key did not change) 3 = updated index and updated data record (key changed) 16 = could not store new key (reindex required) 17 = record update failed (data is unchanged) and could not restore original key (reindex required)Return: Non-zero indicates an error, otherwise the data record located at the record number is updated if required and its key updated if required.