DatabaseName

Description

Sets or returns the physical name of the current database. You cannot change logical name after it is set once.

Setting the name changes the information DevOps Plan uses to connect to the physical database, not the actual database itself. If you change a server name, you must make sure your connection options are consistent with the new name. The database name is one of the parameters for the UserLogon method of Session object.

Setting a new value does not take effect until the ApplyPropertyChanges method is called.

Syntax

Perl


$database->GetDatabaseName(); 
$database->SetDatabaseName(newDbName); 
Identifier
Description
database
A Database object.
newDbName
A String containing the new physical name of the database, including any associated path information (for example, "C:\temp\NewDb.mdb").
Return value
A String containing the current physical name of the database, including any associated path information.

Example

Perl


use CQPerlExt;

#Start a session
$sessionObj = CQSession::Build();

#Get a list of accessible databases
$databases = $sessionObj->GetAccessibleDatabases("MASTR", "admin", "");
$count = $databases->Count();

# Login to each database successively. 
for($x=0;$x<$count;$x++){

   $db = $databases->Item($x);
   $dbName = $db->GetDatabaseName();

   # Logon to the database 
   $sessionObj->UserLogon( "admin", "", $dbName, "" );

   #...
 }
CQSession::Unbuild($sessionObj);