# EssSetDatabaseState

Description

EssSetDatabaseState() sets user-configurable parameters for the database using the database's state structure.

Syntax

    ESS_FUNC_M EssSetDatabaseState (hCtx, AppName, DbName, pDbState);

ESS_HCTX_T | hCtx
ESS_STR_T | AppName
ESS_STR_T | DbName
ESS_PDBSTATE_T | pDbState

Parameters

hCtx | Essbase API context handle
AppName | Application name
DbName | Database name
pDbState | Pointer to database state structure

Return Value

None.

Notes

- EssGetDatabaseState() should be called to initialize the ESS_DBSTATE_T structure before EssSetDatabaseState() is called.
- This function can only set user-configurable parameters for server databases.

Access

This function requires the caller to have Database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.

Example

    ESS_FUNC_M
    ESS_SetDbState (ESS_HCTX_T   hCtx,
                    ESS_HINST_T  hInst
                  )
    {
       ESS_FUNC_M        sts = ESS_STS_NOERR;
       ESS_PDBSTATE_T   DbState;
       ESS_STR_T        AppName;
       ESS_STR_T        DbName;
       AppName = "Sample";
       DbName  = "Basic";

       sts = EssGetDatabaseState (hCtx, AppName,
             DbName, &DbState);
       if (!sts)
       {
          if (DbState)
          {
             /****************************
              * Update DbState structure *
              ****************************/
             sts = EssSetDatabaseState (hCtx, AppName,
                   DbName, DbState);
             EssFree (hInst, DbState);
          }
       }
       return (sts);
    }

See Also

EssGetDatabaseState()
EssSetApplicationState()