getPatternFromTS function

The getPatternFromTS function returns a list of values that you can use as a search pattern.

Syntax

getPatternFromTS(
                 ts            TimeSeries,
                 begin_tstamp  DATETIME YEAR TO FRACTION(5),
                 end_tstamp    DATETIME YEAR TO FRACTION(5),
                 col_name      LVARCHAR)  
 returns LIST(DOUBLE PRECISION NOT NULL)
ts
The time series value for the specified primary key.
begin_stamp
The begin point of the range to search. Can be NULL, which represents the first element in the time series.
end_stamp
The end point of the range to search. Can be NULL, which represents the last element in the time series.
col_name
The name of the column in the TimeSeries data type from which to retrieve the values.
If the index is on a BSON column, include the field name within the BSON document to index after the column name with dot notation. For example, if the subtype column is named value and the field that is indexed is named v1, set the col_name parameter to value.v1.

Usage

Run the getPatternFromTS function to return a search pattern that you can use as input to the TSPatternMatch function to search for matches to the pattern. A search pattern is the list of values from the specified column in the TimeSeries data type for the specified time range. You can run the getPatternFromTS function within the TSPatternMatch function as the pattern argument.

Returns

A list of values in a LIST data type.

Example

The following statement returns a search pattern:

SELECT getPatternFromTS(ts1, '2011-03-01 00:00:00.00000', 
                        '2011-06-01 00:00:00.00000', 'value1')
  FROM tsdata
  WHERE tsdata.id = 2000;

(expression)

LIST{55,55,55,55}