GetIsMaster

Description

Returns a Boolean indicating whether this database is a master database.

A schema repository is a master database for one or more user databases. When manipulating the schema repository, you should use the methods of the AdminSession object.

Syntax

VBScript


dbDesc.GetIsMaster 

Perl


$dbDesc->GetIsMaster(); 
Identifier
Description
dbDesc
A DatabaseDesc object containing information about one of the installed databases.
Return value
True if this database is a schema repository, otherwise false.

Examples

VBScript

The following example shows you how to log on to the database from a Visual Basic application.


set sessionObj = CreateObject("CLEARQUEST.SESSION")
' Login to each database successively. 
databases = sessionObj.GetAccessibleDatabases("MASTR","","") 
For Each db in databases 
   If db.GetIsMaster Then 
      ' Create an AdminSession object and logon to the schema 
      ' repository.
      ' ... 
   ElseIf 
      'Logon to the database using the regular Session object. 
      ' ... 
   End If 
Next 

Perl


use CQPerlExt;

#Start a HCL Compass 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 the master database      

for($x=0;$x<$count;$x++){

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

   if ( $db->GetIsMaster() ) {

      #Create an AdminSession and logon to the schema repository

      #...

   }

   else {

      #Logon to the database using the regular Session object

      #...

   }

} 
CQSession::Unbuild($sessionObj);