PvCopyDatabase()
Copies a database to a new database, adjusting the referential integrity if needed.
Header File: catalog.h (See also Header Files)
Function First Available In Library: w3dbav90.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (OS X) (See also Link Libraries)
Syntax
BTI_API PvCopyDatabase(
   BTI_LONG           hConnection,
   BTI_CHAR_PTR       dbName,
   BTI_CHAR_PTR       newdbName,
   BTI_CHAR_PTR       newdictPath,
   BTI_CHAR_PTR       newdataPath);
Arguments
 
Return Values
 
Remarks
The following preconditions must be met:
Connection established by PvConnectServer() or if you are performing the operation on a local machine, P_LOCAL_DB_CONNECTION may be used as the connection handle.
Example
BTI_LONG connectionHandle = P_LOCAL_DB_CONNECTION;
BTI_CHAR_PTR newdataPath = “c:\\data\\gallery2”;
BTI_CHAR_PTR newdictPath = “c:\\data\\gallery2”;
BTI_CHAR_PTR databaseName = “Gallery”;
BTI_CHAR_PTR newdatabaseName = “GalleryCopy”;
BTI_SINT status = 0;
BTI_CHAR_PTR server = “MyServer”;
BTI_CHAR_PTR user = “Administrator”;
BTI_CHAR_PTR pwd = “Admin”;
//only need to connect to server if it is remote
//otherwise can pass P_LOCAL_DB_CONNECTION for the handle
 
status = PvCopyDatabase(
connectionHandle,
databaseName,
newdatabaseName
dictPath,
dataPath);
See Also
PvStart()
PvConnectServer()
PvCreateDatabase()
PvGetDbFlags()
PvModifyDatabase()
PvDropDatabase()
PvDisconnect()
PvStop()