Databases

Description

Returns the collection of databases associated with the schema repository. This is a read-only property; it can be viewed but not set.

Each element in the returned collection is a Database Object.

Syntax

VBScript


adminSession.Databases 

Perl


$adminSession->GetDatabases(); 
Identifier
Description
adminSession
The AdminSession object representing the current schema repository access session.
Return value
A Databases Object containing the collection of all databases defined in this schema repository.

Example

VBScript


set adminSession = CreateObject("ClearQuest.AdminSession")
set SessionObj = CreateObject("ClearQuest.Session")
adminSession.Logon "admin", "admin", "" 
set databaseList = adminSession.Databases
For each dbObj in databaseList
   dbName = dbObj.DatabaseName
   SessionObj.OutputDebugString "Found database: " & dbName

Next 

Perl


use CQPerlExt;

#Create a HCL Compass Admin session
$adminSession= CQAdminSession::Build();

#Logon as admin
$adminSession->Logon( "admin", "admin", "" );

$databaseList = $adminSession->GetDatabases();

#Get the number of databases
$numDbs = $databaseList->Count();

#Iterate through the databases
for ( $x=0; $x<$numDbs; $x++ ) {
     #Get the specified item in the collection of databases
     $dbObj = $databaseList->Item( $x );
     #Get the name of the database
     $dbName = $dbObj->GetName();
}

CQAdminSession::Unbuild($adminSession);