Difference between revisions of "RECALCULATE Column Constraint"
From Lianjapedia
Yvonne.milne (Talk | contribs) m (1 revision: SQL) |
Helen.george (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Column constraint to force recalculation of calculated columns when a column's value changes | Column constraint to force recalculation of calculated columns when a column's value changes | ||
− | |||
==Syntax== | ==Syntax== | ||
RECALCULATE | RECALCULATE | ||
− | |||
==See Also== | ==See Also== | ||
[[ALTER TABLE]], [[SQL Constraints|CONSTRAINTS]], [[CREATE TABLE]] | [[ALTER TABLE]], [[SQL Constraints|CONSTRAINTS]], [[CREATE TABLE]] | ||
− | |||
==Description== | ==Description== | ||
Line 15: | Line 12: | ||
The RECALCULATE column constraint is used to force recalculation of calculated columns when a column's value changes. Any column which forms part of the calculation expression of a [[CALCULATED_Column_Constraint|CALCULATED]] column must have the RECALCULATE column constraint set. | The RECALCULATE column constraint is used to force recalculation of calculated columns when a column's value changes. Any column which forms part of the calculation expression of a [[CALCULATED_Column_Constraint|CALCULATED]] column must have the RECALCULATE column constraint set. | ||
− | |||
==Example== | ==Example== | ||
Line 25: | Line 21: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SQL]] | [[Category:SQL]] |
Latest revision as of 10:46, 7 December 2012
Contents
Purpose
Column constraint to force recalculation of calculated columns when a column's value changes
Syntax
RECALCULATE
See Also
ALTER TABLE, CONSTRAINTS, CREATE TABLE
Description
A constraint is used to define rules that help to provide data integrity. Column constraints are specific to the column name specified. You must have ALTER privilege on the table. The table will be locked for EXCLUSIVE use during the operation.
The RECALCULATE column constraint is used to force recalculation of calculated columns when a column's value changes. Any column which forms part of the calculation expression of a CALCULATED column must have the RECALCULATE column constraint set.
Example
ALTER TABLE customer; ALTER COLUMN available CALCULATED limit-balance; ALTER COLUMN limit RECALCULATE; ALTER COLUMN balance RECALCULATE