Distributed Tuning Interface Reference : PvModifyDatabase2()
 
PvModifyDatabase2()
Modify an existing database using the specified information for the new database name, dictionary and data paths, database flag, and code page. This function is the same as PvModifyDatabase() except that the database code page is also specified.
Header File: catalog.h (See also Header Files)
Function First Available In Library: w3dbav90.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (macOS) (See also Link Libraries)
Syntax
BTI_API PvModifyDatabase2(
   BTI_LONG           hConnection,
   BTI_CHAR_PTR       dbNameExisting,
   BTI_CHAR_PTR       dbNameNew,
   BTI_CHAR_PTR       dictPath,
   BTI_CHAR_PTR       dataPath,
   BTI_ULONG          dbFlags,
   BTI_LONG          dbCodePage);
Arguments
 
In
hConnection
Connection handle that identifies the server. Connection handles are obtained with the PvConnectServer() function.
In
dbNameExisting
Name of the existing database
In
dbNameNew
Name of the new database. Set this parameter to NULL if you want the database name to remain unchanged.
In
dictPath
Dictionary path.
In
dataPath
Data path. Set this value to NULL to use the default data path (that is, the same as the dictionary path)
If you want to modify a database to include MicroKernel Engine data files located in multiple paths, specify this parameter as a semicolon (;) delimited list. For example: C:\data\path1;C:\data\path2
In
dbFlags
Database flags, which can be a combination of the P_DBFLAG_ constants.
P_DBFLAG_RI (enforce integrity constraints, including referential integrity and triggers)
P_DBFLAG_BOUND (stamps the database name on the dictionary files so only that database can use them)
P_DBFLAG_DBSEC_AUTHENTICATION (use database security authentication, Mixed security policy. See Btrieve Security Policy.)
P_DBFLAG_DBSEC_AUTHORIZATION (use database security authorization, Database security policy. See Btrieve Security Policy.)
P_DBFLAG_LONGMETADATA (use V2 metadata. See Metadata Version.)
In
dbCodePage
For databases on Windows platforms, a number indicating the code page for database data and metadata strings.
For databases on Linux and macOS distributions, one of the following to indicate the code page for database data and metadata strings:
P_DBCODEPAGE_UTF8
P_DBCODEPAGE_EUCJP
P_DBCODEPAGE_ISO8859_1
For databases on Windows, Linux, and macOS, the value can also be a zero or P_DBCODEPAGE_NA.
A zero indicates legacy behavior. That is, no code page is specified, defaulting to the operating system encoding on the server machine. See also Database Code Page in PSQL User's Guide.
P_DBCODEPAGE_NA specifies to leave the code page as is (the database code page is not to be changed).
Note: The database engine does not validate the encoding of the data and metadata that an application inserts into a database. The engine assumes that all data was entered using the encoding of the server or the client as explained in Database Code Page and Client Encoding in Advanced Operations Guide.
Return Values
 
P_OK
The operation was successful.
P_E_INVALID_HANDLE
Invalid connection handle.
P_E_NULL_PTR
Call with NULL pointer
P_E_ACCESS_RIGHT
Insufficient access right for the operation
P_E_NOT_EXIST
Named database does not exist on the server.
P_E_FAIL
Failed for other reasons.
Remarks
The following precondition must be met:
DTI session started by calling PvStart().
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.
Btrieve Security Policy
See Btrieve Security Policy.
See Also
PvConnectServer()
PvCreateDatabase2()
PvCreateDSN2()
PvDisconnect()
PvFreeDbNamesData()
PvGetDbCodePage()
PvGetDbDataPath()
PvGetDbDictionaryPath()
PvGetDbFlags()
PvGetDbName()
PvGetDbNamesData()
PvGetDbServerName()
PvGetDSNEx2()
PvModifyDSN2()
PvStart()
PvStop()