ifx_TSDW_moveWindows() function

The ifx_TSDW_moveWindows function moves time windows in a time series virtual table within a data mart.

Syntax

ifx_TSDW_moveWindows(accelerator_name varchar(128),
                     data_mart_name   varchar(128),
                     table_owner      varchar(32),
                     table_name       varchar(128),
                     num_partitions   integer DEFAULT 1)
returns lvarchar;
accelerator_name
The name of the accelerator.
datamart_name
The name of the data mart.
table_owner
The owner of the table.
table_name
The name of the table.
num_partitions
The number of virtual partitions by which the time window is moved. This value can be a positive or negative integer. The default value is 1.

Usage

Run the ifx_TSDW_moveWindows() function to move time windows of a time series virtual table within a data mart by a number of virtual partitions.

The time series data for the virtual partitions that are no longer used is deleted from the accelerator. The time series data for the virtual partitions that are within the time windows is loaded to the accelerator.

A positive value for num_partitions moves the time windows forward, a negative value moves the time windows backward. When a time window is moved so that a portion of the virtual partitions is no longer within a time stamp of the assigned calendar, the portion outside of the time stamp is removed. When a time window is moved so that none of the virtual partitions are located within a time stamp of the assigned calendar, the entire time window is removed.

If time windows are moved in an active data mart, the time series data is deleted immediately. Depending on the volume of data, this load can take a significant amount of time.

Return values

The ifx_TSDW_moveWindows() function returns the text string "The operation was completed successfully." or an error message.

Examples

In this example, the time windows for the time series virtual table 'informix'.'ts_data_v' in data mart 'datamart_name' on accelerator 'demo_dwa' are moved. A calendar with a start time stamp of '2010-01-01 00:00:00.00000' and a pattern of one month is set for this table. A time window is created that contains time series data for January and February 2011.

  • To move the time window that contains time series data for January and February 2011 forward by one month:
    execute function ifx_TSDW_moveWindows(
      'demo_dwa', 'datamart_name', 'informix', 'ts_data_v');
    The data for January 2011 is deleted on the accelerator, and the data for March 2011 is loaded. The data for February 2011 is unchanged.
  • In the previous example, the original time window was moved forward by one month, so that it contains data for February and March 2011. To move this time window forward by three more months:
    execute function ifx_TSDW_moveWindows(
      'demo_dwa', 'datamart_name', 'informix', 'ts_data_v', 3);
    The data for February and March 2011 is deleted on the accelerator, and the data for May and June 2011 is loaded.