SET Transaction Mode statement

Use the SET Transaction Mode statement to specify whether constraints are checked at the statement level or at the transaction level during the current transaction.

Syntax


1  SET CONSTRAINTS
1 + , constraint
1 ALL
1 IMMEDIATE
1 DEFERRED
Element Description Restrictions Syntax
constraint Constraint whose transaction mode is to be changed All constraints must exist in the same database, which must support logging Identifier

Usage

To enable or disable constraints, or to change their filtering mode, see SET Database Object Mode statement.

This statement is valid only in a database with transaction logging, and its effect is limited to the transaction in which it is executed.

Use the IMMEDIATE keyword to set the transaction mode of constraints to statement-level checking. IMMEDIATE is the default transaction mode of constraints when they are created.

Use the DEFERRED keyword to set the transaction mode to transaction-level checking. You cannot change the transaction mode of a constraint to DEFERRED unless the constraint is currently enabled.