EssGetDatabaseInfoEx

Description

EssGetDatabaseInfoEx() retrieves information for one or more databases, which contains non user-configurable parameters for the databases.

Syntax

ESS_FUNC_M EssGetDatabaseInfoEx (hCtx, AppName, DbName, pusCount; ppDbInfo);
ESS_HCTX_ThCtx
ESS_STR_TAppName
ESS_STR_TDbName
ESS_PUSHORT_TpusCount
ESS_PPDBINFO_T ppDbInfo

Parameters

hCtxEssbase API context handle.
AppNameName of application for which to return database information. If NULL, returns information for all applications and databases.
DbNameName of database for which to return database information. If NULL, returns information for all databases.
pusCountNumber of information structures to be returned
ppDbInfoPointer to array of information structures.

Return Value

If successful, this function returns an array of database information structures.

Notes

Access

This function requires the caller to have at least read access (ESS_PRIV_READ) to the specified database.

Example

ESS_FUNC_M
ESS_GetDatabaseInfoEx (ESS_HCTX_T hCtx, ESS_HINST_T hInst)   
{
   ESS_FUNC_M      sts = ESS_STS_NOERR;
   ESS_STR_T      AppName;
   ESS_STR_T      DbName;    
   ESS_PDBINFO_T  DbInfo = NULL;
   ESS_USHORT_T   Count;
   ESS_USHORT_T   ind;
   
   AppName = "Sample";
   DbName  = "";
   
   sts = EssGetDatabaseInfoEx(hCtx, AppName, DbName,
         &Count, &DbInfo);
   
   if(!sts && DbInfo)
   { 
printf("\r\n------- Database Info Ex --------\r\n\r\n");
      for(ind = 0; ind < Count; ind++)
      {
printf("AppName: %s\r\n",DbInfo[ind].AppName);
printf("DbName: %s\r\n",DbInfo[ind].Name);
printf("DbType: %d\r\n",DbInfo[ind].DbType);
printf("Status: %d\r\n",DbInfo[ind].Status);
printf("nConnects: %d\r\n",DbInfo[ind].nConnects);
printf("nLocks: %d\r\n",DbInfo[ind].nLocks);
printf("----------------------------------\r\n\r\n");
      }
      EssFree(hInst, DbInfo);
   }
      return (sts);
}

See Also

EssGetApplicationInfo()
EssGetDatabaseInfo()
EssGetDatabaseState()
EssGetDatabaseStats()