![]() |
SQL-J Language Reference
|
Reference Manual |
SET CONSTRAINTS statementThe SET CONSTRAINTS statement allows you to temporarily disable or re-enable a specific foreign key or check constraint or constraints, all foreign key or check constraints in a table, or all foreign key and check constraints in a database. In addition, you are allowed to specify a primary key or unique constraint. Disabling a foreign key or check constraint actually disables the constraint. "Disabling" a primary or unique constraint disables all the foreign keys that reference that constraint and does not actually turn off the primary or unique constraint. Syntax
SET CONSTRAINTS Re-enabling a constraint requires that every row in the table meet the constraint condition. If a row violates the constraint, the constraint remains in DISABLED mode, and an exception is thrown. If a single SET CONSTRAINTS command affects more than one constraint and any single constraint fails, no constraints are re-enabled, and an exception is thrown. SET CONSTRAINTS Examples
-- turn off the foreign-key and check constraints
-- turn them all back on
-- turn off all foreign keys that reference the Cities The state of a constraint (whether it is enabled or disabled) is reflected in the STATE column of SYS.SYSCONSTRAINTS. Primary and unique keys that have been "disabled" are marked disabled in this table, even though only foreign keys that reference them are actually disabled. |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |