HP NEOVIEW 544530-001 Manual do Utilizador Página 77

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 142
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 76
1 2 ... 72 73 74 75 76 77 78 79 80 81 82 ... 141 142

Comentários a estes Manuais

Sem comentários