GetWorkSpace
Description
Returns the session's Workspace object.
You can use the Workspace object to manipulate saved queries, charts, and reports in the Rational® ClearQuest® workspace.
Syntax
VBScript
session.GetWorkSpace
Perl
$session->GetWorkSpace();
- Identifier
- Description
- session
- The Session object that represents the current database-access session.
- Return value
- The Workspace object belonging to the current session.
Examples
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";
}