ALTER TRIGGER

Description

In the trigger definition, STATUS and PRIORITY options can be changed by using the ALTER statement. If you need to alter other parts of the trigger (event targets or conditional expressions), you must delete and then re-create the trigger.

Syntax

ALTER TRIGGER trigger_name  trigger_option [ ; ]

trigger_option :

STATUS { ACTIVE | INACTIVE }

PRIORITY key

Example

The following example shows how to create the medal_trig trigger and then change its state to INACTIVE and its priority to 0.7.

CREATE TRIGGER medal_trig

STATUS ACTIVE

BEFORE PDATE ON participant

IF new.gold < 0 OR new.silver < 0 OR new.bronze < 0

EXECUTE REJECT;

ALTER TRIGGER medal_trig STATUS INACTIVE;

ALTER TRIGGER medal_trig PRIORITY 0.7;

Caution