Neoview Command Interface (NCI) Guide (R2.3)

6 Running NCI From Perl or Python
You can execute an SQL statement in Perl or Python by invoking the NCI Perl or Python wrapper
script. To use the Perl or Python wrapper script, see:
“Setting the Login Environment Variables” (page 81)
“Perl and Python Wrapper Scripts” (page 84)
“Launching NCI From the Perl or Python Command Line” (page 84)
“Launching NCI From a Perl or Python Program” (page 86)
These instructions assume that you installed the Neoview Command Interface product. For more
information, see Chapter 2 (page 23).
NOTE: NCI provides a beta version of enhanced support for Perl and Python programs. This
functionality enables multiple SQL statements to run in one database connection from a Perl or
Python program. For more information, see the README in the Neoview Command Interface
samples directory.
Setting the Login Environment Variables
Before launching NCI from Perl or Python, set these login environment variables:
DescriptionEnvironment Variable
Specifies the host name or IP address of the database
platform to which you want the client to connect. The
host-name should include the domain name of the
database platform if it is different from the domain of the
client workstation. If you do not specify a port number,
NCI uses the default port number, which is 18650.
HPNCI_SERVER=host-name[:port-number]
HPNCI_SERVER=IP-address[:port-number]
Specifies the user name to log in to the database platform.
HPNCI_USER=user-name
Specifies the password of the user to log in to the database
platform.
HPNCI_PASSWORD=password
Specifies the name of a data source.
HPNCI_DATASOURCE=data-source-name
If you do not set these environment variables, NCI prompts you to enter the host name, user
name, and password each time you invoke NCI on the Perl or Python command line. Invoking
NCI from within a Perl or Python program requires you to set these login environment variables.
To set the login environment variables, see the instructions for the operating system of the client
workstation:
“Setting the Login Environment Variables on Windows” (page 81)
“Setting the Login Environment Variables on Linux or UNIX” (page 83)
Setting the Login Environment Variables on Windows
You can set the login environment variables for the session at command prompts, or you can set
the login environment variables for the system or user by including them in the System Properties.
Setting Login Environment Variables on the Command Line
At each command prompt, enter one of these commands:
set HPNCI_SERVER=host-name:port-number
set HPNCI_USER=user-name
set HPNCI_PASSWORD=password
set HPNCI_DATASOURCE=data-source-name
Setting the Login Environment Variables 81