SQL/MX Remote Conversational Interface (RMXCI) Guide for SQL/MX Release 3.2 (H06.25+, J06.14+)

3. To activate the changes, either log out and log in again or run the user profile command, for
example:
/home:. .profile
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 on Linux:
rmxci-installation-directory/rmxci/bin
rmxci-installation-directory is where you installed the RMXCI software files. For more
information, see Table 2 (page 32).
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 this Linux 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
The same command can be used in Windows.
To run a Python program, enter the python command at a command prompt. In the Linux
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
The same command can be used in Windows.
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)
74 Running RMXCI from Perl or Python