Set Constraint
Set Constraint
Purpose
Use the SET CONSTRAINTS statement to specify, for a particular transaction,
whether a
deferrable constraint is checked following each DML statement (IMMEDIATE) or
when the
transaction is committed (DEFERRED). You can use this statement to set the
mode for a list of
constraint names or for ALL constraints.
The SET CONSTRAINTS mode lasts for the duration of the transaction or until
another SET
CONSTRAINTS statement resets the mode.
Note:
You can also use an ALTER SESSION statement with the SET CONSTRAINTS
clause to set
all deferrable constraints. This is equivalent to making issuing a SET
CONSTRAINTS
statement at the start of each transaction in the current session.
You cannot specify this statement inside of a trigger definition.
SET CONSTRAINTS can be a distributed statement. Existing database links that
have transactions
in process are notified when a SET CONSTRAINTS ALL statement is issued, and
new links are
notified that it was issued as soon as they start a transaction.
Prerequisites
To specify when a deferrable constraint is checked, you must have the READ or
SELECT privilege
on the table to which the constraint is applied unless the table is in your schema.