Neoview Command Interface (NCI) Guide (R2.5)
Example of a Perl Program (example.pl)
use lib 'C:\\neo\\nci\\lib\\perl';
use Session;
# create a session object
$sess = Session->new();
# connect to the database
$sess->connect("super.services","password","neo0101 ","18650","TDM_Default_DataSource");
$retval=$sess->execute(" set schema NEO.HPNCI_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)
import os
import sys
## Modify this path
sys.path.append("C:\\neo\\nci\\lib\\python")
import Session
# create a session object
sess = Session.Session()
# Connect to the database
x=sess.__connect__("super.services","password","neo0101","18650","TDM_Dfault_DataSource")
# Execute sample queries
# __execute takes the query string as argument
setSchema = "set schema NEO.HPNCI_SAMPLE";
selectTable = "select * from employee"
getStats = "get statistics"
#Contruct a list of SQL statements to be executed
queryList = [setSchema, selectTable, getStats]
print "\n";
for query in queryList:
print sess.__execute__(query)
# disconnect the session
sess.__disconnect__()
del sess
sess=None
Launching NCI From the Perl or Python Command Line 69