STS_GetNoDataTimeRange function
The STS_GetNoDataTimeRange function returns the duration of time when an object had no data.
Syntax
STS_GetNoDataTimeRange(
ts TimeSeries,
begin_time DATETIME YEAR TO FRACTION(5),
end_time DATETIME YEAR TO FRACTION(5))
returns STS_NoDataTimeRange_r
- ts
- The time series value.
- begin_time
- The start of the time range. NULL indicates the time stamp of the first element in the time series.
- end_time
- The end of the time range. NULL indicates the time stamp of the last element in the time series.
Usage
Run the STS_GetNoDataTimeRange function to know for how long an object had no data and whether the state of the object was a no signal condition or an interrupted signal condition.
Returns
A ROW data type = The start time, end time, and state of the object. The ROW data type has the following structure:
create row type STS_NoDataTimeRange_r(
begin_time DATETIME YEAR TO FRACTION(5),
end_time DATETIME YEAR TO FRACTION(5),
state INTEGER);
The values of the state column are:
- 2 = No signal. The location of the object did not change.
- 3 = Interrupted signal. The location of the object changed.
An exception = An error.
Example
The following query returns when vehicle 1001 had no signal or an interrupted signal:
SELECT * FROM TABLE(STS_GetNoDataTimeRange(
(SELECT ts_track FROM t_vehicle WHERE modid = 1001), NULL, NULL))
AS t(r);
r ROW('2014-06-07 20:52:53.00000','2014-06-10 16:49:36.00000',3 )
1 row(s) retrieved.
Vehicle 1001 had an interrupted signal between 2014-06-07 20:52:53.00000 and 2014-06-10 16:49:36.00000.