PvCheckDbInfo()
Checks the consistency of a database.
Header File: catalog.h (See also Header Files)
Function First Available In Library: w3dbav75.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (OS X) (See also Link Libraries)
Syntax
BTI_API PvCheckDbInfo(
BTI_LONG hConnection,
BTI_CHAR_PTR dbName,
BTI_ULONG checkFlags);
Arguments
Return Values
Named database specified in dbName does not exist.
Remarks
If the database is consistent, then the return value for this function is P_OK. If the database is not consistent or if the function call fails, then the return value is one of the error codes listed above.
Example
BTI_WORD res; // returned value from function call
BTI_CHAR_PTR dbName; // database name
BTI_ULONG checkFlags; // database flags
BTI_LONG hConnection; // connection handle
BTI_LONG reserved;
// reserved value for PvStart() and PvStop()
 
// Initialize variables.
dbName = “demodata”;
// The name of the database is demodata
checkFlags = 0xFFFFFFFF; // Checks all flags
hConnection = P_LOCAL_DB_CONNECTION;
// Set the connection handle to local connection
 
// P_LOCAL_DB_CONNECTION is defined in config.h
reserved = 0;
 
// Start a DTI session before making any DTI calls.
res = PvStart (reserved);
 
if (res == P_OK)
{
// DTI session started successfully.
// You can now make multiple DTI calls here.
res = PvCheckDbInfo (hConnection,
dbName,
checkFlags);
 
if (res == P_OK)
{
// Database is consistent.
}
else
{
// Put your code here to handle the error code
// returned from PvCheckDbInfo ().
}
// Close DTI session.
Res = PvStop (&reserved);
}
See Also
PvStart()
PvConnectServer()
PvGetDbNamesData()
PvGetDbName()
PvFreeDbNamesData()
PvDisconnect()
PvStop()