Distributed Tuning Interface Reference : PvAlterUserName()
 
PvAlterUserName()
Alters an existing user's name in the specified database.
Header File: ddf.h (See also Header Files)
Function First Available In Library: w3dbav90.dll (Windows), libpsqldti.so (Linux), libpsqldti.dylib (macOS) (See also Link Libraries)
Syntax
PRESULT DDFAPICALLTYPE PvAlterUserName(
   BTI_WORD            dbHandle,
   const BTI_CHAR*     user,
   const BTI_CHAR*     newName);
Arguments
 
In
dbHandle
Handle of an open database returned by PvOpenDatabase().
In
user
Database user name.
In
newName
New name for the database user. If set to NULL, the function fails.
Return Values
 
PCM_Success
The operation was successful.
PCM_errFailed
The operation was not successful.
PCM_errInvalidAccountName
The specified account or user name does not exist, or the new name is invalid.
PCM_errUserAlreadyExists
New user name already exists.
PCM_errDatabaseHasNoSecurity
Database has no security.
PCM_errSessionSecurityError
Database opened with insufficient privilege.
Remarks
This function will fail if newName is set to NULL, or if newName is already present in the database.
The following preconditions must be met:
You must first open a dictionary successfully using PvOpenDatabase() as user 'Master'.
The associated database has database-level security enabled.
The user name must already exist in the specified database.
The new user name cannot already exist in the specified database.
The following post condition must be met:
Use PvCloseDatabase() to free the resources.
See Also
PvAlterUserPassword()
PvAddUserToGroup()
PvRemoveUserFromGroup()
PvCreateUser()
PvDropUser()
PvOpenDatabase()
PvCloseDatabase()