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_ThCtx
ESS_STR_TAppName
ESS_STR_TDbName
ESS_PDBSTATE_T pDbState

Parameters

hCtxEssbase API context handle
AppNameApplication name
DbNameDatabase name
pDbStatePointer to database state structure

Return Value

None.

Notes

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()