TRIGGER

Overview

Starts (or queue for execution) one or more pipelines after this one completes. This operation allows you to daisy-chain pipelines and multicast change logs to additional targets.

The Trigger operation can only be specified as the last command in a SQL CDC batch command.

Some DataZen agents limit the number of triggers available based on the SKU.

Syntax

Starts another pipeline upon completion of the current one.

TRIGGER '...' 
    ON < SUCCESS | SUCCESS_WITH_DATA | COMPLETION | ERROR > 
    { DELAY N }
;

ON

The condition to trigger the next pipeline: SUCCESS, SUCCESS_WITH_DATA, COMPLETION, ERROR

DELAY

The number of seconds to wait at a minimum before starting the trigger (0 = no delay)

Example 1

-- Get data from an RSS Feed
SELECT * FROM HTTP [Rss Feed] (GET /econi.xml) APPLY TX (//item);

-- Start one or more pipelines depending on the outcome of this pipeline
TRIGGER 'pipeline_notify' ON SUCCESS;
TRIGGER 'pipeline_sendemail' ON FAILURE;
TRIGGER 'pushToDrive' ON COMPLETION DELAY 30;