DELETEARCHDATA action
Function | Deletes the data of a historical value within a time interval. | |||||||||||||||
Declaration | DELETEARCHDATA archIdent, timeFromIdent_TmA, timeToIdent_TmA [,statusIdent_Int] | |||||||||||||||
or | ||||||||||||||||
DELETEARCHDATA archIdent, timeFromIdent_TmA, timeToIdent_TmA, [statusIdent_Int], bRecalcStat | ||||||||||||||||
Parameters |
| |||||||||||||||
Description | The action will remove the data of the historical value archIdent within the time interval defined from timeFromIdent_TmA to timeToIdent_TmA. Naturally, the values of the parameters must be in the following relation: timeFromIdent_TmA <= timeToIdent_TmA (otherwise the error ERR_RANGE_ERROR is generated). The optional parameter statusIdent_Int represents the action success and may acquire one of the following values:
Deleted data has not got the attribute "deleted" (unlike deleting the D2000 HI - the attribute DELETED), but they are physically deleted from the archive database. | |||||||||||||||
Note 1 | The parameter archIdent:
| |||||||||||||||
Note 2 | If parameter statusIdent_Int is set, DELETEARCHDATA is terminated as soon as all required values are deleted. Even if the parameter bRecalcStat is used and his value is @TRUE, the action does not wait on termination of recalculation of dependent statistic archives. | |||||||||||||||
Example 1 | TIME _timeFrom TIME _timeTo INT _status _timeTo := %StrToTime("10:00:00 31-12-1999") _timeFrom := %StrToTime("09:00:00 31-12-1999") DELETEARCHDATA H.ArchObj, _timeFrom, _timeTo, _status IF _status = _ERR_NO_ERROR THEN ; data are deleted ELSE ; some error has occurred ENDIF | |||||||||||||||
Example 2 | TIME _timeFrom TIME _timeTo INT _status _timeTo := %StrToTime("10:00:00 31-12-1999") _timeFrom := %StrToTime("09:00:00 31-12-1999") ; deleting + calculation of dependent statistic archives - synchronously DELETEARCHDATA H.ArchObj, _timeFrom, _timeTo, _status, @TRUE IF _status = _ERR_NO_ERROR THEN ; data are deleted ELSE ; some error has occurred ENDIF ; deleting + calculation of dependent statistic archives - asynchronously DELETEARCHDATA H.ArchObj, _timeFrom, _timeTo, @TRUE |
Related pages:
Pridať komentár