EssGetDatabaseStats

Gets a database's stats structure, which contains statistical information about the database.

Syntax

ESS_FUNC_M EssGetDatabaseStats (hCtx, AppName, DbName, ppDbStats);
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle

AppName

ESS_STR_T

Application name

DbName

ESS_STR_T

Database name

ppDbStats

ESS_DBSTATS_T

Address of pointer to receive allocated database stats structure pointer

Notes

Return Value

If successful, this function returns a pointer to an allocated database stats structure in ppDbStats.

Access

This function requires the caller to have at least read access (ESS_PRIV_READ) to the database, and to have selected it as their active database using EssSetActive().

Example

ESS_FUNC_M
ESS_GetDbStats (ESS_HCTX_T  hCtx,
                ESS_HINST_T hInst
               )
{
   ESS_FUNC_M        sts = ESS_STS_NOERR;
   ESS_PDBSTATS_T   pDbStats;
   ESS_STR_T        AppName;
   ESS_STR_T        DbName;
   AppName = "Sample";
   DbName  = "Basic";
   
   sts = EssGetDatabaseStats (hCtx, AppName,
         DbName, &pDbStats);
   if (!sts)
   {   
      if (pDbStats)
      {   
         EssFree (hInst, pDbStats);
      }
   }
 
   return(sts);
}

See Also