TSL_PutRow function

The TSL_PutRow function loads a row of time series data.

Syntax

TSL_PutRow(
           handle      lvarchar,
           primary_key lvarchar,
           row    ROW)
returns integer
handle
The table and column name combination returned by the TSL_Attach or the TSL_Init function.
primary_key
A primary key value. Can be a composite of multiple values separated by a pipe symbol. For example, if a primary key in the source table consists of two columns, id1 and id2, a primary key value where id1 is 5 and id2 is 2 is represented as: ’5|2’.
row
A ROW data type with values that are compatible with the TimeSeries column in the handle.

Usage

Use the TSL_PutRow function to load a row of time series data as part of a loader program. You must run the TSL_PutRow function in the context of a loader session that was initialized by the TSL_Init function.

You can run the TSL_PutRow function multiple times in the same session. The data is stored in the database server until you run the TSL_Flush function to write the data to disk.

Returns

  • An integer that indicates the number of records that were inserted.
  • An exception if no records were inserted.

Examples

This example runs in the context of an initialized loader session.

The following statement loads a row of data from a ROW data type that is cast to the TimeSeries data type named readings:

EXECUTE FUNCTION TSL_PutRow('meter|readings', '5',
  row( datetime(2011-01-01 00:15:00.00000) year to fraction(5),
       1.0)::reading);