HistorianDeleteRecords

(Engine-Level Function)

Description: Conditionally deletes full sequences of records from the data store identified by the ConnectionHandle
Warning:

This function should be used only by advanced programmers.

The functions, WriteHistory and GetTagHistory and GetLog are recommended for most uses.

Returns: An array of SequenceID values, indicating which sequences were deleted
Usage: Script Only.
Threaded: Yes
Related to: HistorianConnect | HistorianGetData | HistorianGetInfo | HistorianReadRecords | HistorianWriteRecords
Format: HistorianDeleteRecords (ConnectionHandle, TagName, Schema, MinGroupValue, NumRecordsToKeep)
Parameters:  
ConnectionHandle
As returned by an HistorianConnect call.
TagName
A text string identifying the tag whose records are to be deleted.
Schema
This is a textual representation of a schema structure.
MinGroupValue
All sequences with a Group Value (the last 4 bytes of the 12-byte SequenceID) less than this value will be deleted, provided that the NumRecordsToKeep condition is also met.
NumRecordsToKeep
A numeric expression, specifying a minimum number of records that are to be kept for the tag.
Comments:

This function will delete as many entire sequences from storage for a tag as it can so that at least NumRecordsToKeep records are kept, and only sequences with a lower group value than MinGroupValue are deleted.

While considered to be threaded, this function has no lifetime after it passes the records to another thread for deletion.

Example:

No example provided. This function is not recommended for most use.