HP NEOVIEW 544530-001 Manuel d'utilisateur Page 77

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 142
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 76
#-----Reorganize the table --------------------------------------------------
$status=`perl /usr/local/hp/nvscript/bin/hpnvs.pl "$reorgtable"`;
print "Reorg status :".$status;
print "\n";
#----------Update the statistics of the table--------------------------------
$status=`perl /usr/local/hp/nvscript/bin/hpnvs.pl "$updatestats"`;
print "Update statistics status :".$status;
print "\n";
#--------------Fetch results-------------------------------------------------
@resultrows=`perl /usr/local/hp/nvscript/bin/hpnvs.pl "$selecttable"`;
#-------------Display the results--------------------------------------------
foreach $rowvalue (@resultrows)
{
print $rowvalue;
}
Example of a Python Program (example.py)
import os
import sys
import string
if __name__ == '__main__':
#Define SQL statements
reorgtable="REORG TABLE neo.persnl.employee";
updatestats="UPDATE STATISTICS FOR TABLE neo.persnl.employee "
updatestats=updatestats + "ON EVERY COLUMN";
selecttable="SELECT COUNT(*) FROM neo.persnl.employee";
#Contruct a list of SQL statements to be executed
stmnt = [reorgtable,updatestats,selecttable]
print "\n";
for stmntstr in stmnt:
cin, cout ,cerr = os.popen3('python /usr/local/hp/nvscript/bin/hpnvs.py "'+stmntstr+'"')
while 1:
text = cout.read()
if text:
print text
else:
break
while 1:
text = cerr.read()
if text:
print text
else:
break
cin.close()
cout.close()
Running the Perl or Python Program
Before running the Perl or Python program, make sure that you included the absolute path of
the Perl or Python wrapper script (hpnvs.pl or hpnvs.py) in the program file:
On Windows:
hpnvs-installation-directory\nvscript\bin\hpnvs.pl
or
hpnvs-installation-directory\nvscript\bin\hpnvs.py
hpnvs-installation-directory is the directory where you installed the Neoview
Script software files. For more information, see Table 2-1 (page 34).
On Linux or UNIX:
hpnvs-installation-directory/nvscript/bin/hpnvs.pl
or
hpnvs-installation-directory/nvscript/bin/hpnvs.py
Launching Neoview Script From a Perl or Python Program 77
Vue de la page 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 141 142

Commentaires sur ces manuels

Pas de commentaire