Previous Topic: TRANSFERDIRECTION Statement—Specify the File Transfer DirectionNext Topic: TRIG_TYPE Statement—Specify the Type of Database Change to Monitor For


TRIG_COND Statement—Specify a Condition to Monitor

The TRIG_COND statement specifies a condition to monitor the database for.

Supported Job Type

This statement is optional for the Database Trigger job type.

Syntax

This statement has the following format:

TRIG_COND condition
condition

Specifies the condition to monitor in the database.

Limits: Up to 256 characters; case-sensitive

Note: For the specific database syntax, refer to your database vendor's documentation.

Notes:

Example: Specify Trigger Condition for Microsoft SQL Server

In the following example, a Database Trigger job monitors the SALES table for changes to the ord_date and qty columns. The job completes only when both columns have changed.

AGENT DB_AGENT
USER sa
DB_URL 'jdbc:sqlserver://myhost:1433;DatabaseName=pubs'
TRIG_TYPE UPDATE
TABLE_NAME SALES
TRIG_COND 'UPDATE(ord_date) and UPDATE(qty)'

Example: Specify Trigger Condition for IBM DB2

In the following example, a Database Trigger job monitors the STAFF table for changes to the DEPT and JOB columns. The job completes once DEPT or JOB is updated.

AGENT DB_AGENT
USER entadm
DB_URL jdbc:db2://10.1.4.131:50000/SAMPLE
TABLE_NAME STAFF
TRIG_TYPE 'UPDATE of DEPT, JOB'

Example: Specify Trigger Condition for Oracle

In the following example, the table Inventory_List is monitored continuously for updates. When the table is updated, if the number of units of productA has fallen below 1000, the scheduling manager triggers the predefined alert ALOW.

AGENT CYBDB1
TABLE_NAME Inventory_List CONTINUOUS(ALOW)
TRIG_TYPE UPDATE
TRIG_COND 'new.ProductA < 1000'