ts_put_elem_no_dups() 函数

ts_put_elem_no_dups() 函数将新元素放入现有的时间系列。即使时间系列中已存在具有给定时间戳记的元素,仍将插入该元素。

语法

ts_timeseries *
ts_put_elem_no_dups(ts_tsdesc   *tsdesc, 
                     ts_tselem   tselem, 
                     mi_datetime *tstamp)
tsdesc
要修改的时间系列的描述符,由 ts_open() 返回。
tselem
要添加的元素。
tstamp
放入元素时的时间戳记。将忽略 tselem 的时间戳记列。

描述

如果时间戳记是 NULL,数据会追加到时间系列(对于常规时间系列),或者发生错误(对于非常规时间系列)。

如果给定时间点存在数据,会更新为新数据;否则,会插入新数据。

传入的元素必须与时间系列的子类型匹配。

无法更新隐藏的元素。

等效 SQL 函数是 PutElemNoDups

返回结果

已添加该元素的原始时间系列。