ALTER TRIGGER statement (basic)


The ALTER TRIGGER statement defines changes to be made to a Db2 trigger.


GUID-92915A50-BFCA-4552-97AF-06E4E76D6313-low.png

ALTER TRIGGER schema 1.triggerName 1

This option specifies the name of the trigger to be changed.

SCHEMA schema 2

This option specifies the new schema of the trigger.

NAME triggerName 2

This option specifies the name of the trigger.

OWNER triggerOwner

This option specifies the owner of the trigger.

TABLE tableOwner.tableName

This option specifies the triggering base table of the associated trigger.

ACTIVATE

This option specifies whether the trigger is activated before or after the triggering event.

ACTIVATE parameter values

Value

Description

BEFORE

Specifies to activate the trigger before the event.

AFTER

Specifies to activate the trigger after the event.

GRANULARITY

This option specifies whether Db2 executes the triggered action for each row or for each statement.

GRANULARITY parameter values

Value

Description

ROW

Specifies to execute the action for each row.

STATEMENT

Specifies to execute the action for each statement.

ONEVENT

This option specifies when Db2 executes the trigger.

ONEVENT parameter values

Value

Description

INSERT

Specifies to have Db2 execute the trigger when an insertion occurs.

DELETE

Specifies to have Db2 execute the trigger when a deletion occurs.

UPDATE ALLCOLUMNS

Specifies to have Db2 execute the trigger when an update occurs, and to update all of the columns in the table.

UPDATE COLUMNS columnNameList

Specifies to have Db2 execute the trigger when an update occurs, and to update a list of columns in columnNameList.

REFOLDCORR correlationName

This option specifies the OLD AS correlation name.

NOREFOLDCORR

This option removes the OLD AS correlation name.

REFNEWCORR correlationName

This option specifies the NEW AS correlation name.

NOREFNEWCORR

This option removes the NEW AS correlation name.

REFOLDTB identifier

This option specifies the OLD _TABLE AS identifier.

NOREFOLDTB

This option removes the OLD _TABLE AS identifier.

REFNEWTB identifier

This option specifies the NEW_TABLE AS identifier.

NOREFNEWTB

This option removes the NEW_TABLE AS identifier.

PATH (schemaList)

This option specifies the path for the trigger.

COMMENT 'string'

This option specifies the comment for the trigger.

NOCOMMENT

This option removes the comment for the trigger.

SECURED

This option specifies that the trigger is secured.

NOT SECURED

This option specifies that the trigger is not secured

TRIGGERTEXT (triggerText)

This option specifies the triggered action for the trigger.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

ALTER and BMC AMI Change Manager for Db2 13.1