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);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
AppName | ESS_STR_T | Name of application for which to return database information. If NULL, returns information for all applications and databases. |
DbName | ESS_STR_T | Name of database for which to return database information. If NULL, returns information for all databases. |
pusCount | ESS_PUSHORT_T | Number of information structures to be returned |
ppDbInfo | ESS_DBINFO_T | Pointer to array of information structures. |
Notes
The memory allocated for the ppDBInfo structure should be freed using EssFree().
This function can only get the information structure for server databases.
Return Value
If successful, this function returns an array of database information structures.
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