# EssDefaultCalc

Description

EssDefaultCalc() executes the default calculation for the active database.

Syntax

    ESS_FUNC_M EssDefaultCalc (hCtx);

ESS_HCTX_T | hCtx

Parameters

hCtx | Essbase API context handle.

Return Value

None.

Notes

- If this function succeeds and the calculation is started, it will continue on the server as an asynchronous process after the return from this call . The caller must check at regular intervals to see if the process has completed by calling EssGetProcessState() until it returns ESS_STATE_DONE().
- To get and set the default calc script, use the functions EssGetDefaultCalc(), EssSetDefaultCalc() and EssSetDefaultCalcFile().

Access

This function requires the caller to have calc privilege (ESS_PRIV_CALC) to the active database.

Example

    ESS_FUNC_M
    ESS_CalcDefault  (ESS_HCTX_T          hCtx)
    {
       ESS_FUNC_M           sts = ESS_STS_NOERR;
       ESS_PROCSTATE_T   pState;

       sts = EssDefaultCalc(hCtx);
       if (!sts)
       {
          sts = EssGetProcessState (hCtx, &pState);
          while (!sts || (pState.State !=
                  ESS_STATE_DONE))
                sts = EssGetProcessState (hCtx,
                      &pState);
       }

      return (sts);
    }

See Also

EssBeginCalc()
EssCalc()
EssGetDefaultCalc()
EssSetDefaultCalc()
EssSetDefaultCalcFile()