Difference between revisions of "RECALCULATE Column Constraint"
From Recital Documentation Wiki
Helengeorge (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(One intermediate revision by one user not shown) | |||
Line 14: | Line 14: | ||
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. | 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. | + | 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== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | ALTER TABLE customer | + | ALTER TABLE customer; |
− | ALTER COLUMN available CALCULATED limit-balance | + | ALTER COLUMN available CALCULATED limit-balance; |
− | ALTER COLUMN limit RECALCULATE | + | ALTER COLUMN limit RECALCULATE; |
− | ALTER COLUMN balance RECALCULATE | + | ALTER COLUMN balance RECALCULATE |
</code> | </code> | ||
==Products== | ==Products== | ||
− | Recital | + | Recital, Recital Server |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:SQL]] | [[Category:SQL]] |
Latest revision as of 11:37, 22 December 2009
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
Products
Recital, Recital Server