Click here for aggregate storage version
Execute a stored calculation, the stored default calculation (determined by alter database), or an anonymous (non-stored) calculation string.
Minimum permissions required:
For stored calculations (CALC-NAME): Granted access to the calculation.
For anonymous calculations (CALC-STRING): Database Manager permission.
For default calculation: execute privilege.
Syntax

You can run calculations in the following ways using execute calculation.
| Keyword | Description |
|---|---|
execute calculation <calc-name> | Run the specified stored calculation script. |
<calc-name> on database | Run the specified stored calculation script against the specified database. |
<calc-string> on <dbs-name> | Run an anonymous calculation, whose body is contained in <calc-string>, against the specified database. |
default on <dbs-name> | Run the default calculation against the specified database. |
Notes
A stored calculation can be associated with an application/database, or with an application only. To execute a calculation stored at the application level, you must specify which database to calculate using the syntax 'on database STRING.'
Example
execute calculation Sample.Basic.calcname;
Calculates the Sample.Basic database using a stored calculation file assocatied with the database.
execute calculation Sample.calcname on database Basic;
Calculates the Sample.Basic database using a stored calculation file assocatied with the application Sample.
execute calculation 'SET MSG ERROR; CALC ALL;' on Sample.basic;
Calculates Sample.Basic using an anonymous (unstored) calculation string.