RIV::OQL module synopsis
The RIV::OQL module synopsis shows how
to make calls to the constructor and database operation methods that
this module provides.
The comments provided in the synopsis serve as a quick reference as to the purpose of the constructor and database operation methods. The reference (man) pages for the constructor and each method provide the details.
# Load the RIV::OQL module
use RIV::OQL;
# Call the RIV::OQL constructor, passing to $appSession one of the
# following blessed references:
#
# + A RIV::Agent object (returned in a previous call to the
# RIV::Agent constructor)
# + A RIV::App object (returned in a previous call to the
# RIV::App constructor)
#
# The $precisionService parameter takes one of the valid Network Manager
# service names, for example, ncp_disco (Disco service).
#
# The calls to the database operation methods are made through a
# reference to the RIV::OQL session object ($oql->) that the RIV::OQL
# constructor returns.
#
$oql = new RIV::OQL($appSession, $precision_Service);
# Call the Send method to send an OQL query to the specified database.
#
$oql->Send($oqlStatement, $returnResults);
#
# Call the CreateDb method to create a database in the Network Manager
# service specified in a previous call to the RIV::OQL constructor.
#
$oql->CreateDB($databaseName);
#
# Call the CreateTable method to create a table in the database.
#
$oql->CreateTable($databaseName, $tableName, \%columnNamesandTypes);
#
# Call the Insert method to insert records into a database table.
$oql->Insert($database, $table, \%record);
#
# Call the Select method to execute a specific OQL command.
oql->Select($database, $table, $columnName);
#
# Call the RIV module's GetResult function to get input data.
my ($type, $data) = $oql->RIV::GetResult(10);
#
# Call the Print method to print the contents of the records obtained
# as a result of this database query.
$oql->Print($data);
#
# Call the Delete method to delete records from the database table.
$oql->Delete($database, $table, $clauseForDeletion);
#
# Call the Update method to update records that currently reside in
# the database.
$oql->Update($database, $table, $setClause, $whereClause);