GetWorkSpace

Descrizione

Restituisce l'oggetto Workspace della sessione.

È possibile utilizzare l'oggetto Workspace per gestire le query, i grafici e i report salvati nel workspace Rational ClearQuest.

Sintassi

VBScript

session.GetWorkSpace 

Perl

$session->GetWorkSpace(); 
Identificativo
Descrizione
session
L'oggetto Session che rappresenta la sessione di accesso al database corrente.
Valore di ritorno
L'oggetto Workspace che appartiene alla sessione corrente.

Esempi

VBScript

set sessionObj = GetSession 

' Get the workspace for manipulating query, chart, and report info.
set wkSpc = sessionObj.GetWorkSpace 

Perl

#Get a Rational ClearQuest session

$sessionObj = $entity->GetSession();



#Get the workspace for manipulating query, chart, and report 

$MyWorkSpace = $sessionObj->GetWorkSpace();



#Get a list of queries in the workspace...

$MyQueriesListREF = $MyWorkSpace->GetAllQueriesList();

foreach (@$MyQueriesListREF) {

  print ("$_\n");

}

#The QueryDef object contains information about a workspace

#query, including the query name and the SQL string used

#to execute the query.

foreach $QueryName (@$MyQueriesListREF) {

  # Get the QueryDef associated with that query...

  $QueryDef = $MyWorkSpace->GetQueryDef($QueryName);

  # Build the ResultSet object to hold the results of

  # the query...

  $ResultSet = $Session->BuildResultSet($QueryDef);

  # Execute the query...

  $ResultSet->Execute();

  # Get the query's short name (without the pathname)...

  @QueryPath = split('/', $QueryName);

  $QueryShortName = @QueryPath[$#QueryPath];

  # Process/display the results of the query...

  print "\n" if ($PrintDetails);

  print "$QueryShortName:  ";

  for ($N = 0; (($ResultSet->MoveNext()) ==

  $CQPerlExt::CQ_SUCCESS); $N++) {

    if ($PrintDetails) {

      printresultrow();

    }

  }

  print "$N\n";

} 

Feedback