Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

FunctionDeletes the data of a historical value within a time interval.
Declaration


Blok kódu
languageesl
themeConfluence
DELETEARCHDATA archIdent, timeFromIdent_TmA, timeToIdent_TmA [,statusIdent_Int]



or


Blok kódu
languageesl
themeConfluence
DELETEARCHDATA archIdent, timeFromIdent_TmA, timeToIdent_TmA, [,statusIdent_Int], bRecalcStat


Parameters


archIdentinReference to one of (historical) value, column or row of structured historical value (see Note).
timeFromIdent_TmAin Identifier of AbsTime type - beginning of the interval.
timeToIdent_TmAinIdentifier of AbsTime type - end of the interval.
statusIdent_IntoutAction success (optional parameter).
bRecalcStatinIdentifier of Boolean type.
A calculation of dependent statistic archives. If the parameter is not set the dependent statistic archives will not be calculated.


DescriptionThe 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:
  • _ERR_TRANS_ABORT
  • _ERR_TRANS_ERROR
  • _ERR_TRANS_IGNORED
  • _ERR_NO_ERROR
If the parameter is not defined, the action generates a request to delete and script execution continues. There is no possibility to test the action success.

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.
Kotva
note
note
Note 1
The parameter archIdent:
  • not controlled whether the archive object is used - adding a reference to the object is enough,
  • can also contain the reference to a part (row or column) or an entire structured historical value.
Example:
  • H.ColArchiv - reference to entire structured historical value
  • H.ColArchiv[2] - reference to all values of structured historical value within the second row
  • H.ColArchiv^ColName - reference to all values of structured historical value within the ColName column
Note 2If 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


Blok kódu
languageesl
themeRDark
 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


Blok kódu
languageesl
themeRDark
 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


...