Modes for Triggers and Duplicate Indexes
You can specify ENABLED or DISABLED as the only object modes for triggers on tables, and for triggers on views, and for indexes that allow duplicate values.
You can specify the modes for triggers or duplicate indexes.
If you specify no mode for an index or for a trigger when you create it or in a subsequent SET Database Object Mode statement, the object is enabled by default.
Example of changing the mode of an index
The following example of
the SET INDEXES statement disables the unique acc_num_ix index.
which was created in ENABLED mode by default:
CREATE TABLE accounts (
acc_num INTEGER DEFAULT 1,
acc_type CHAR(1) DEFAULT 'A',
acc_descr CHAR(20) DEFAULT 'New Account',
acc_bal MONEY(9,2)
acc_id CHAR(32) DEFAULT CURRENT_USER);
CREATE DISTINCT INDEX acc_num_ix ON accounts (accr_num);
SET INDEXES acc_num_ix DISABLED;
Here the SET
INDEXES statement used the Object-list format to specify the index
by name. Because no other index is defined on the accounts table,
the following SET INDEXES statement that uses the Table format has
the same effect:
SET INDEXES FOR accounts DISABLED;
Example of changing mode of a trigger
The
following example enables a backup_accts trigger that was created
in DISABLED mode:
SET TRIGGERS backup_accts ENABLED;