HELP: Modify data in an existing archive (add, insert and/or update data in latest archive version) TYPE: OBJECT SYNTAX: MODIFY(NET.{},STORE/SAVE.{},FLAM(),PREPROCESS[()...],POSTPROCESS/PSTPRO[()...])
Use this object to modify an an existing FLAM archive. Like with OLD, the MODIFY mode writes a new archive version, but allows you modify data stored in the latest previous version.
By default, this means that records and elements are added sequentially. However, the record mode can be used to control what happens if a record already exists in the data. You can control whether it is overwritten (update), deleted or inserted, if it does not exist.
For update, insert and delete operations, it is essential to use table support and index columns and to mark parts of these columns as primary keys. Without indexing, every data segment that has already been written must be searched to check for duplicates, which becomes very slow with large data sets.
The record handling mode can be configured to only generate a warning instead of an error or to ignore the respective record if it already exists during insert or if it does not exist during update or delete. With the KEYED mode, either an insert is made if the record is not found or an update is made if the key already exists in the data. If records are deleted, you can decide whether cleanup of the member matrix should be performed when the archive is closed. If this is not done, you may waste some computing time because empty matrices are marked deleted, but are not removed from the index.
To open an existing archive, you must specify where the archive is stored
using the STORE
parameter. It also allows you to delete the previous
version or all older versions after the new version was written
successfully. Remember that deleting old versions only marks the data as
deleted. To actually remove all deleted segment data that is no longer
required, the archive must be pruned (PRUNE). Depending on the storage
backend, this can be an expensive operation. For file-based archives, the
whole archive is rewritten.
If the archive is encrypted, you must also provide credential via the
FLAM.DECRYPT()
parameter to unlock a keyset in order to decrypt the
contents. This keyset is automatically used to write the new version so
that all previously valid credentials can also access the new archive
version.
You can replace or add additional keysets, just like the REKEY command,
while writing the new version by specifying FLAM.ENCRYPT()
with the
desired parameters. Have a look at the REKEY command for
details.