QueryGetResults

The QueryGetResults method gets multiple results from the Query command.

Method Synopsis

QueryGetResults()

Parameters

None.

Description

The QueryGetResults method gets all the results from a previously run Query method. This QueryGetResults method is commonly used when you expect the query to return a limited number of records. As each record is turned into a hash reference, it can use much memory. When the results are retrieved, the results are no longer available within the OQL client.

Example Usage


my $query = "select * from disco.agents;";
$oql->Query($query);

my $queryData = $oql->QueryGetResults();
if($queryData)
{
$recCount = scalar(@$queryData);

print "query $query returned $recCount results.\n";

foreach my $dat (@$queryData)
{
print "Got result.\n";
print Dumper($dat);
}
}
else
{
print "Query $query returned nothing.\n";
}

Returns

Upon completion, the QueryGetResults method returns a reference to a hash list, which contains the results of the query.

See Also