The ts_put_elem_no_dups() function

The ts_put_elem_no_dups() function puts a new element into an existing time series. The element is inserted even if there is already an element with the given time stamp in the time series.

Syntax

ts_timeseries *
ts_put_elem_no_dups(ts_tsdesc   *tsdesc, 
                     ts_tselem   tselem, 
                     mi_datetime *tstamp)
tsdesc
A descriptor of the time series to be modified, returned by ts_open().
tselem
The element to add.
tstamp
The time stamp at which to put the element. The time stamp column of tselem is ignored.

Description

If the time stamp is NULL, the data is appended to the time series (for regular time series) or an error is raised (for irregular time series).

If there is data at the given timepoint, it is updated with the new data; otherwise, the new data is inserted.

The element passed in must match the subtype of the time series.

Hidden elements cannot be updated.

The equivalent SQL function is PutElemNoDups.

Returns

The original time series with the element added.