GetDatabaseSetName
Description
Returns the name of the database set of which this database is a member.
You can use this method to get the database set name
of this database. You can pass this name to the Session object's GetAccessibleDatabases method
to get a list of the user databases in the database set.
Note: By default, systems have only one database
set. You can refer to this default database set using an empty string
("") instead of the name returned by this method.
Syntax
Perl
$dbDesc->GetDatabaseSetName();
- Identifier
- Description
- dbDesc
- A DatabaseDesc object containing information about one of the installed databases.
- Return value
- A String containing the name of the database set.
Example
Perl
use CQPerlExt;
#Start a DevOps Plan session
$sessionObj = CQSession::Build();
#Get a list of accessible database description objects
$databases = $sessionObj->GetAccessibleDatabases("MASTR", "", "");
#Get the number of databases
$count = $databases->Count();
#Foreach accessible database that is not the master database, login as
#user "tom" with password "gh36ak3"
for($x=0;$x<$count;$x++){
$db = $databases->Item($x);
if (! $db->GetIsMaster() ) {
#Get the database set of which this database is a member
$dbSetName = $db->GetDatabaseSetName();
#Get the database name from the description object
$dbName = $db->GetDatabaseName();
# Logon to the database
$sessionObj->UserLogon( "tom", "gh36ak3", $dbName, $dbSetName );
}
#...
}
CQSession::Unbuild($sessionObj);