Caché Class Definition Reference
SqlComputeOnChange
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

This keyword controls when the property is recomputed. Applies only to triggered computed properties.
Usage
To specify when a property is recomputed, use the following syntax:
Property name As classname [ SqlComputed, SqlComputeCode=sqlcomputecode, SqlComputeOnChange = propertynames ];
Where sqlcomputecode is described in SqlComputeCode and propertynames is either a single property name or a comma-separated list of property names. This value can also include the values %%INSERT or %%UPDATE.
Note that you must use the actual property names, rather than the values given by SqlFieldname.
Details
This keyword applies only to triggered computed properties; it is ignored for other properties. (A triggered computed property is a property for which SqlComputed is true and SqlComputeCode is specified, but for which Calculated and Transient are both false. See Defining a Computed Property in Using Caché Objects.)
This keyword controls the conditions under which this property is recomputed. Recomputation can result from:
If the keyword has a value of %%INSERT or %%UPDATE, then INSERT or UPDATE calls, respectively, specify event-triggered computation of the value of the field (property).
Any event-triggered computation occurs immediately before validation and normalization (which themselves are followed by writing the value to the database).
Note:
Event-triggered computation of a field’s value may override any explicitly specified value for the property, depending on the code that computes the property’s value.
Default
The default value for the SqlComputeOnChange keyword is an empty string.
See Also