Create On-Update Trigger
The MaxL create on update trigger statement helps you create or replace a trigger to track state changes over a selected Essbase cube area. The trigger is activated immediately when a cell is updated.
Triggers help you track whether designated constraints are violated during updates (events) in the area, and allow you to specify resultant actions to execute if violations are detected.
Minimum permission required: Database Manager.
An on-update trigger is the default type of trigger, even if no type is specified. During a data update process, any cell update that meets a condition specified for the cube area will immediately activate the trigger. On-update triggers are not supported in aggregate storage databases. If you are using an aggregate storage database, you can create after-update triggers.
Note:
If a calculation assigns the same value to a given cell as was already present before the calculation, then triggers for that cell will not activate. In other words, if cell values are not changed, blocks are not marked as dirty, and triggers for those blocks are not activated, even if the trigger condition was otherwise met.
Note:
You cannot create or replace a trigger during a calculation, data update, or data load.
Keywords
Use the MaxL create on update trigger statement to create a trigger in the following ways:
- create [on update] trigger TRIGGER-NAME...
-
Create a new on-update trigger. The on update keywords are optional; an on-update trigger is created by default.
- create or replace [on update] trigger TRIGGER-NAME...
-
Create an on-update trigger, or replace an existing trigger of the same name.
- create [on update] trigger ... log_value OFF...
-
The optional log_value OFF syntax logs no data values to the trigger spool file. This is the default.
- create [on update] trigger ... log_value ON...
-
The optional log_value ON syntax logs new and old data values to the trigger spool file.
- create [on update] trigger ... where <cube area>...
-
The where clause is how you define the area of the cube to be tracked. Use a valid, symmetric MDX Slicer Specification.
- create [on update] trigger ... when <condition>...
-
The when clause is how you define the condition to be tested. Use the keyword WHEN followed by a valid MDX conditional expression. To test for a condition, you can use MDX conditional and logical operators, Boolean functions, and MDX iterative functions.
- create [on update] trigger ... then <action>...
-
The then clause is how you define the action to be taken if the WHEN condition is met. Refer to examples in Examples of Triggers.
- create [on update] trigger ... else <action>...
-
The optional else clause is a way to define an action to be taken if the WHEN condition is not met. Refer to examples in Examples of Triggers.
- create [on update] trigger ... end
-
The END keyword must terminate every create trigger statement.
Example
create or replace on update trigger Sample.Basic.EastColas log_value ON where (Jan, Sales, Actual, [100], East) when Jan > 1850 then spool EastColas_alert end;