Previous Topic: TRIG_COND Statement—Specify a Condition to MonitorNext Topic: TRIGCOND Statement—Specify a Condition to Monitor


TRIG_TYPE Statement—Specify the Type of Database Change to Monitor For

The TRIG_TYPE statement specifies the type of database change to monitor for.

Supported Job Type

This statement is required for the Database Trigger job type.

Syntax

This statement has the following formats:

TRIG_TYPE INSERT
TRIG_TYPE DELETE
TRIG_TYPE UPDATE
INSERT

Monitors for the insertion of a row in the database table.

DELETE

Monitors for the deletion of a row in the database table.

UPDATE

Monitors for an update to any of the rows in the database table.

Notes:

Example: Specify Trigger Type for MS SQL Server

In the following example, a Database Trigger job monitors the stores table for an added row or a deleted row. When a row is either added or deleted, the job completes.

AGENT CYBDB
TABLE_NAME stores
TRIG_TYPE 'INSERT, DELETE'

Example: Specify Trigger Type 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 Type for Oracle

In the following example, the table Inventory_List is monitored continuously for the insertion of a row in the table. When a row is inserted, the scheduling manager triggers the predefined alert INC.

AGENT CYBDB1
TABLE_NAME Inventory_List CONTINUOUS(INC)
TRIG_TYPE INSERT