SQL/MX Remote Conversational Interface (RMXCI) Guide for SQL/MX Release 3.1 (H06.23+, J06.12+)

Perl and Python wrapper scripts
The wrapper scripts enable you to run SQL statements and script files using a single connection or
multiple connections within Perl or Python programs. The Perl wrapper script is rmxci.pl,
and the Python wrapper script is rmxci.py. By default, these wrapper scripts are located in the
bin directory as shown below:
rmxci-installation-directory/rmxci/bin
rmxci-installation-directory is where you installed the RMXCI software files. For more
information, see Table 2 (page 17).
Launching RMXCI from the Perl or Python command-line
You can launch RMXCI using wrapper scripts as shown:
To run a Perl program, enter the perl command at a command prompt. In the example,
rmxci.pl wrapper script is invoked and the perl script example.pl is run:
rmxci-installation-directory/rmxci/bin:perl rmxci.pl example.pl
To run a Python program, enter the python command at a command prompt. In the example,
rmxci.py wrapper script is invoked and the python script example.py is run:
rmxci-installation-directory/rmxci/bin:python rmxci.py example.py
Example of a Perl Program (example.pl)
use lib '/usr/home/rmxci/lib';
use Session;
# create a session object
$sess = Session->new();
# connect to the database
$sess->connect("super.services","password",
"nsksys.ind.hp.com",
"18650","TDM_Default_DataSource");
$retval=$sess->execute(" set schema RMXCI.RMXCI_SAMPLE ");
print $retval;
$retval=$sess->execute("select * from employee");
print $retval;
$retval=$sess->execute("get statistics");
print $retval;
print "\n\nSession 1: Disconnecting first session. \n\n";
$sess->disconnect();
Example of a Python Program (example.py)
52 Running RMXCI from Perl or Python