This function returns information about an EDMdatabase. The database may be either open or closed when invoking the function.
When creating an EDMdatabase, the block size is the only configuration parameter that needs to be set by the user. Later, that block size must allways be used when addressing the database. The block size of an EDMdatabase will be returned by this function.
Some EDM updates introduce changes in the way internal data is organized in the EDMdatabase. Such changes will result in database incompatibility. To open an EDMdatabase, one must ensure that the version of EDM is compatible with the database. Database versions are identified by a version sequence number. That version number will be returned by this function.
IIf the EDMdatabase cannot be opened due to incompatible database versions, the actual EDMdatabase must be dumped by an EDMserver/EDMinterface that supports the actual EDMdatabase version, and then restored by the actual running EDMserver/EDMinterface. For details, see the EDMsupervisor commands Database>Dump and Database>Restore
Some users may need an EDMdatabase that allows creating a very high number of models. Others may need few models, but a huge number of instances within each model. To taylor such features, a special version of EDM must be generated by EPM. Databases generated by such special EDM versions will be incompatible with mainstream EDM versions. This function will return the maximum number of models that may be created in a database. Default is 256 models. This number must match that of your EDM Version.
Note that EDMdatabases created by EDM Versions older than EDM Release 4.7 will return zero in the parameter maxModelsInDB. I.e because this concept was introduced as of EDM Release 4.7.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetDatabaseVersion(SdaiString location,
SdaiString databaseName,
SdaiInteger *databaseVersion,
SdaiInteger *databaseBlockSize,
SdaiInteger *maxModelsInDB)
Arguments:
Location |
The path to the directory where the database is located. The <location> must be specified as an absolute path of the actual EDMserver. |
databaseName |
Name of the EDMdatabase. |
databaseVersion |
Address of a variable that will receive the EDMdatabase version identifier of the specified EDMdatabase. |
databaseBlockSize |
Address of a variable that will receive the database block size of the specified EDMdatabase. |
maxModelsInDB |
Address of a variable that will receive the maximum number of models in the specified EDMdatabase. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiString location = "D:
databases";
SdaiString databaseName = "PDM";
SdaiInteger dataBaseVersion, databaseBlockSize, maxModelsInDB;
. . .
if (rstat = edmiGetDatabaseVersion(location,
databaseName,
&dataBaseVersion,
&databaseBlockSize,
&maxModelsInDB)) {
/* Error in operation */
printf("\nError: %s in edmiGetDatabaseVersion \n",
edmiGetErrorText(rstat));
goto error;
}
printf("\nVersion: %d, BlockSize: %d, Max Models: %d\n",
dataBaseVersion, databaseBlockSize, maxModelsInDB);
. . .