DelRange function

The DelRange function deletes all elements in the specified time range in the specified time series instance, including the delimiting timepoints. The DelRange function is similar to the DelTrim function except that the DelRange function deletes elements and reclaims space from any part of a regular time series.

Syntax

DelRange(ts          TimeSeries, 
       begin_stamp datetime year to fraction(5), 
       end_stamp   datetime year to fraction(5),
       flags       integer default 0) 
returns TimeSeries;
ts
The time series to act on.
begin_stamp
The begin point of the range.
end_stamp
The end point of the range.
flags
Valid values for the flags argument are described in The flags argument values. The default is 0.

Description

Use the DelRange function to delete elements in a time series instance from a specified time range and free any resulting empty pages. For example, you can remove data from the beginning of a time series instance to archive the data.

If you use the DelRange function to delete hidden elements, or if the begin point of the range falls before the origin of the time series, an error is raised.

Returns

A time series with all elements in the range between the specified timepoints deleted.

Example

The following example removes all elements in a one-day range on the specified day for the specified time series instance:
UPDATE ts_data
SET meter_data = DelRange(meter_data,
        '2010-11-11 00:00:00.00000'
     ::datetime year to fraction(5),
        '2010-11-11 00:00:00.00000'
     ::datetime year to fraction(5))
WHERE loc_esi_id = 4727354321000111;