UpdElem function

The UpdElem function updates an existing element in a time series.

Syntax

UpdElem(ts         TimeSeries, 
         row_value  row,
         flags      integer default 0) 
returns TimeSeries;
ts
The time series to update.
row_value
The new row data.
flags
Valid values for the flags argument are described in The flags argument values. The default is 0.

Description

The element must be a row type of the correct type for the time series, beginning with a time stamp. If there is no element in the time series with the given time stamp, an error is raised.

Hidden elements cannot be updated.

The API equivalent of UpdElem is ts_upd_elem().

Returns

A new time series containing the updated element.

Example

The following example updates a single element in an irregular time series:
update activity_stocks
set activity_data = UpdElem(activity_data,
   row('2011-01-04 12:58:09.12345', 6.75, 2000, 
   2, 007, 3, 1)::stock_trade)
where stock_id = 600;