The ts_first_elem() function

The ts_first_elem() function returns the first element in the time series.

Syntax

ts_tselem 
ts_first_elem(ts_tsdesc  *tsdesc, 
               mi_integer *STATUS)
tsdesc
The time series descriptor returned by ts_open().
STATUS
A pointer to an mi_integer value. See The ts_hide_elem() function for an explanation of the STATUS argument.

Description

If the time series is regular, the first element is always the origin of the time series. If the time series is irregular, the first element is the one with the earliest time stamp. The value must not be freed by the caller. The element is overwritten after two calls to fetch elements using this tsdesc (time series descriptor).

The equivalent SQL function is GetFirstElem.

Returns

The first element in the time series.