Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 14 NOV 1989 | 2.X | EXPERT | INDEX.FLUSH |
INDEX.FLUSH is a subroutine that forces a Btree index update, when required.
INDEX.FLUSH(file_spec, index)
In Advanced Revelation, a TCL level command (INDEX) as well as a menu option (Tools-Files-Index-Update) are provided to enable users to force a Btree index update as required. You can have the same result within R/BASIC by calling the routine INDEX.FLUSH. INDEX.FLUSH can be configured to update one or all indexes with pending transactions. When calling INDEX.FLUSH, you should be aware that since INDEX.FLUSH is a batch process, it will not stop for user input, unlike the normal incremental batch update. INDEX.FLUSH will only stop when the specified Btree indexes have been completely flushed.
The source datafile name, the account name for this file, and the volume label. The volume label is stored in the first field of a specified record in the VOLUMES file. The account name is stored in the third field of a specified record in the FILES file. The names must be delimited by * (asterisk). If file_spec is null, all indexes for all files (in attached volumes) are updated.
The name of the index to update. If null, all indexes for file_spec are updated.
/* The following code demonstrates index flushing in three situations: when a file specification and indexed field are provided, when a file is specified without declaring a field, and when INDEX.FLUSH is to update all indexes for all files. */ DECLARE SUBROUTINE INDEX.FLUSH, MSG, FSMSG file = "SAMPLE_INVOICES" account = "GLOBAL" volume = "DATAVOL" OPEN "VOLUMES" TO volume_var THEN READ volume_rec FROM volume_var, volume THEN media = volume_rec<<1>> END ELSE FSMSG() END END file_spec = file:"*":account:"*":media indexed_fld = "DATE" * update the specific index INDEX.FLUSH(file_spec, indexed_fld) * update all indexed fields in the specified file INDEX.FLUSH(file_spec, "") * update all indexed fields in all files INDEX.FLUSH("", "") STOP