HP Neoview Script GuideHP Part Number: 544530-001Published: May 2007Edition: HP Neoview Release 2.1
10
SyntaxRESET PARAM [param-name]param-nameis the name of the parameter for which you specified a value. Parameter namesare case-sensitive. For example,
-------------------- 62 --- 1 row(s) selected.SQL>SAVEHIST CommandThe SAVEHIST command saves the session history in a user-specif
to use for separating columns in each row of the results. The default delimiter is “ ”(whitespace).SyntaxSET COLSEP [separator] ConsiderationsIn the N
--- SQL operation complete.SQL> INSERT INTO COURSE1 VALUES+> ('C11', 'INTRO TO CS','FOR ROOKIES',3, 100,'CI
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• If you execut
<td>STEVENS SUPPLY</td> <td>700510</td> <td>2003-06-01</td></tr><tr> <td>3333</td>
<Results><Query> <![CDATA[select * from author;]]></Query><rowid="1"> <AUTHORID>91111</AUTHORID>
Examples• This SET LIST_COUNT command specifies that the number of rows to be displayed bySELECT statements is five:SQL>set list_count 5SQL>sele
The EXECUTE statement substitutes parameter values for the parameters in the preparedstatement. For more information about EXECUTE, see the Neoview SQ
NOTE: The names of the named parameters, ?sal and ?job, in the SELECT statementare identical to the parameter names, sal and job, in the SET PARAM com
List of Figures1-1 Neoview Script Within a Neoview Platform Network...2111
SQL>• This command displays the session user name for the prompt:SQL>set prompt %user>dba1>• This command displays the operating mode of t
%DATASOURCE displays the session data source as the prompt.Considerations• In the Neoview Script interface, you must enter the command on one line. Th
SET SQLTERMINATOR CommandThe SET SQLTERMINATOR command sets the SQL statement terminator of the current session.The default is a semicolon (;).SyntaxS
Starting with the R2.1 release, the default is a 24–hour military style display. The additionalargument of 12h allows the time to be displayed in a 12
SyntaxSHOW COLSEP ConsiderationsIn the Neoview Script interface, you must enter the command on one line. The command doesnot require an SQL terminator
Examples• This command shows that the idle timeout value of the session is 30 minutes, which is thedefault:SQL>show idletimeoutIDLETIMEOUT 30 min(s
ExamplesThis command displays the value set for the markup option:SQL>show markupMARKUP RAWSHOW MODE CommandThe SHOW MODE command displays the oper
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• If you do not
quotes. To look for similar values, specify only part of the charactersof wild-card-pattern combined with these wild-card characters:Use a percent sig
SyntaxSHOW PARAMConsiderations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator
Examples• This SHOW PREPARED command shows all the prepared statements, by default:SQL>show preparedS1 select * from t1S2 select * fr
wild-card-patternis a character string used to search for and display schemas withnames that match the character string. wild-card-pattern matchesan u
SHOW SESSION CommandSHOW SESSION or SESSION displays attributes of the current Neoview Script session. You canalso use the ENV command to perform the
Current setting (on or off) of the elapsed time. By default, the elapsed time is off.For more information, see “Displaying the Elapsed Time” (page 54)
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• You can execu
look for similar values, specify only part of the characters ofwild-card-pattern combined with these wild-card characters:Use a percent sign to indica
SyntaxSHOW TABLE {table-name | materialized-view-name}, { INDEXES | MVS | SYNONYMS |ALL}table-name is: [schema-name.]table-nametable-namespecifies
Index 2 :XEMPDEPT-----------------DEPTNUM ASC Other No 0 1Index 3 :XEMPNAME1-----------------LAST_NAME
wild-card-patternis a character string used to search for and display tables with namesthat match the character string. wild-card-pattern matches anup
SyntaxSHOW TIMEConsiderationsIn the Neoview Script interface, you must enter the command on one line. The command doesnot require an SQL terminator.Ex
List of Tables2-1 Locations of Neoview Script Software Files...3413
for similar values, specify only part of the characters ofwild-card-pattern combined with these wild-card characters:Use a percent sign to indicate ze
ONstarts the logging process and records information in the sqlspool.lstfile in the Neoview Script bin directory.ON CLEARinstructs Neoview Script to c
ConsiderationsIn the Neoview Script interface, you must enter the command on one line. The command doesnot require an SQL terminator.ExampleThis comma
B Supported SQL StatementsNeoview Script supports these SQL statements, SQL utilities, and other SQL-related commands.For more information about these
DescriptionSQL StatementInserts rows of data into a table or view.INSERTLocks the specified table (or underlying tables of a view)and its associated i
C Connectivity Service CommandsNeoview Script supports connectivity service commands in the Neoview Script interface inconnectivity service (CS) mode.
Available servers for this service on this data source(registered minus connected servers)AvailSrvrCntNumber of idle servers to start when data source
IndexSymbols-DhpnvsLF property, 35-dsn parameter, 46-h parameter, 46-host parameter, 46-no connect parameter, 47-noconnectexamples of, 50-p parameter,
INFO DS command, 135INSERT statementdescription of, 134example of, 54Installation proceduresdownloading the Neoview Script installer file, 27testing t
description of, 134examples of, 75, 76Port number, default, 45PREPARE statementdescription of, 134examples of, 60Product banner, 51Promptscontinuation
syntax of, 127SHOW TIME command, 128SHOW TIMING command, 129SHOW VIEWS commandexample of, 57syntax of, 129SPOOL commandexamples of, 64syntax of, 130Sp
141
About This DocumentThis manual describes how to use the Neoview Script command-line interface on a clientworkstation to manage a database on a Neoview
Describes how to run Neoview Script from Perl or Python.Chapter 6: Running NeoviewScript From Perl or PythonProvides syntax, considerations, and examp
| Vertical Line A vertical line separates alternatives in a horizontal list that is enclosedin brackets or braces. For example:{expression | NULL}… El
Neoview Customer LibraryThis manual is part of the Neoview customer library:• AdministrationInformation about how to load and manage the Neoview datab
Installation and replacement procedures.Neoview Hardware Installation and SupportGuideInformation on managing and configuring Dashboard from theDashbo
© Copyright 2007 Hewlett-Packard Development Company, L.P.Legal NoticeConfidential computer software. Valid license from HP required for possession, u
1 Introduction to Neoview ScriptNeoview Script is a command-line interface that you download and install on a client workstationthat has the Neoview J
2 Installing Neoview ScriptNOTE: If you are manually installing Neoview Script on a Linux platform that has the Neoviewdata loader installed, use the
After installing the Java version, proceed with “Verifying the Java Version” (page 24).Verifying the Java VersionTo display the Java version of the cl
4. Under System variables, select the variable named Path, and then click Edit:Preinstallation Procedures 25
5. Place the cursor at the beginning of the Variable Value field and type the path of the Javabin directory, ending with a semicolon (;):For example:&
1. Change the directory to the lib directory, which contains the JDBC driver JAR file:• On Windows, enter this command:cd jdbc-installation-directory\
1. Locate or create a directory or folder for the installer file anywhere on the client workstation.2. On the client workstation, start a Web browser
5. At a command prompt, change to the directory where you downloaded the installer:cd installer-directoryinstaller-directory is the directory where yo
Table of ContentsAbout This Document...15Intended
3. Select hpt4jdbc.jar so that it appears in the File Name box, and then click Select:The Installer Wizard now displays the path of the JDBC driver JA
4. To find an installation location for Neoview Script, click Browse next to HP Neoview Scriptinstallation directory:5. Select the folder where you wa
The Installer Wizard displays the directory where the Neoview Script will be installed.6. Click Install to start the installation:32 Installing Neovie
The Installation Status dialog box appears on the screen, indicating how many files areinstalled in the installation directory:The number of files tha
4. Enter an existing directory where you would like to install Neoview Script:HP Neoview Script--------------------------------------Enter the install
Table 2-1 Locations of Neoview Script Software Files (continued)DescriptionFilesDirectoryBeta version of sample Perl program1sample-beta.plBeta versio
execute in the Neoview Script interface. Each look-and-feel type accepts all the SQL statements,commands, and syntax that Neoview Script currently sup
If you do not set a look and feel, the default is Neoview SQL.Setting the Look and Feel at a Command-Line PromptTo set the _JAVA_OPTIONS environment v
3. If _JAVA_OPTIONS does not appear among the environment variables, click New underSystem or User variables. If _JAVA_OPTIONS already exists, click E
6. In the System Properties dialog box, click OK to accept the changes.To return to the default look and feel, Neoview SQL, set the -DhpnvsLF property
Presetting the Optional Launch Parameters...45Logging In to the Datab
2. If you cannot connect to the database, verify that:1. The database platform is available and running, the port number is correct for thedatabase pl
3 Launching the Neoview Script InterfaceThis chapter describes how to launch the Neoview Script interface from the Windows, Linux, orUNIX environment:
2. Type the location of hpnvs.cmd within double quotes (“) or click Browse to locate that file,and then click Next:For the location of the Neoview Scr
4. If desired, specify optional launch parameters for the shortcut:a. Right-click the shortcut icon and select Properties:b. Click the Shortcut tab.c.
For more information, see “Using Optional Launch Parameters” (page 46).d. Click OK.5. To launch Neoview Script, double-click the shortcut icon.The Neo
hpnvs-installation-directory is the directory where you installed the NeoviewScript software files. For more information, see Table 2-1 (page 34). Che
3. Enter your password.4. Enter the name of a data source that is available and running (that is, started).If you do not enter a data source, Neoview
DescriptionLaunch ParameterSpecifies that an SQL statement or a Neoview Scriptinterface command be run when launching the NeoviewScript interface. You
Although you can run any of the Neoview Script interface commands with -q or -sql, the @,OBEY, and PRUN commands are the most useful. For a list of su
DISCONNECT command. To quit the interface immediately after executing a script file, includethe EXIT, QUIT, or DISCONNECT command at the end of the sc
SPOOL log-file or LOG log-file Command...64Using the CLEAR Option...
Example of Launching Neoview Script File With -noconnect• On Windows, in the Command Prompt window, enter:cd hpnvs-installation-directory\nvscript\bin
4 Running Commands Interactively in the Neoview ScriptInterfaceAfter launching the Neoview Script interface, you can run SQL statements and Neoview Sc
You can continue any SQL statement over multiple lines, breaking that statement at any pointexcept within a word, a numeric literal, or a multicharact
SCHEMA USRSERVER neo0101.acme.com:18650SQLTERMINATOR ;TIME OFFTIMING OFFUSER role.dbaSQL>For more info
20:32:26 SQL ENTER>set time offSQL ENTER>For more information, see the “SET TIME Command” (page 112).Setting and Showing the SQL TerminatorThe S
SQL>For more information, see the “SET TIMING Command” (page 113).Setting and Showing the Current SchemaBy default, the schema of the session is US
• “Showing the Views in a Schema” (page 57)• “Showing the Synonyms in a Schema” (page 57)Showing the SchemasThe SHOW SCHEMAS command displays the sche
SQL>For more information, see the “SHOW TABLE Command” (page 125).Showing the Views in a SchemaThe SHOW VIEWS command displays the views that exist
For more information, see the “SHOW SYNONYMS Command” (page 124).Displaying Executed CommandsTo display commands that were recently executed in the Ne
Running SQL StatementsIn the Neoview Script interface, you can run SQL statements interactively. For a list of SQLstatements that you can run interact
Examples...84DI
SQL>For more information, see the “/ Command” (page 82), “RUN Command” (page 100), or “REPEATCommand” (page 98).Preparing and Executing SQL Stateme
Setting ParametersIn a Neoview session, you can set a parameter of an SQL statement (either prepared or not) byusing the SET PARAM command.NOTE: The p
dn 1500sal 80000.00SQL>For the syntax of the RESET PARAM command, see the “RESET PARAM Command” (page 99).Executing a Prepared SQL StatementTo exec
TED MCDONALD 2000 PETER SMITH 3300 MARK FOLEY 4000 HEIDI
hpnvs-installation-directory is the directory where you installed the NeoviewScript software files. For more information, see Table 2-1 (page 34).• On
For information about error messages that might appear in the log file, see the Neoview MessagesManual.Logging Output 65
5 Running Scripts in the Neoview Script InterfaceIn the Neoview Script interface, you can run script files.• “Creating a Script File” (page 67)• “Runn
the section name in the @ or OBEY command. For more information, see the“@ Command”(page 81) or the “OBEY Command” (page 93).Example of a Script FileT
NOTE: If the script file is outside the directory of the hpnvs.cmd or hpnvs.sh file (by default,the Neoview Script bin directory), you must specify th
Considerations...100Exampl
NOTE: Starting with the 2.1 release, the PRUN command can be run in non-interactive mode.The PRUN command now allows options to be specified on the co
6 Running Neoview Script From Perl or PythonYou can execute an SQL statement in Perl or Python by invoking the Neoview Script Perl orPython wrapper sc
set HPNVS_PASSWORD=passwordset HPNVS_DATASOURCE=data-source-nameSetting Login Environment Variables in the System Properties1. Right-click the My Comp
4. In the Environment Variables dialog box, click New under System or User variables,whichever you prefer.5. In the New User Variable dialog box, type
export HPNVS_SERVER=host-name:port-numberexport HPNVS_USER=user-nameexport HPNVS_PASSWORD=passwordexport HPNVS_DATASOURCE=data-source-nameAt each comm
You can pass only one SQL statement at a time on the Perl or Python command line. The SQLstatement must:• Be enclosed in double quotes (") withou
For example:>cd /usr/local/hp/nvscript/bin>perl hpnvs.pl "POPULATE INDEX neo.persnl.xempname >ON neo.persnl.employee"• On the Pytho
#-----Reorganize the table --------------------------------------------------$status=`perl /usr/local/hp/nvscript/bin/hpnvs.pl "$reorgtable"
hpnvs-installation-directory is the directory where you installed the NeoviewScript software files. For more information, see Table 2-1 (page 34).To r
A Neoview Script Interface CommandsNeoview Script supports these commands in the Neoview Script interface or in script files thatyou run in the Neovie
Syntax...114
SyntaxDescriptionCommandSee the “RUN Command” (page 100).Runs the previously executed SQLstatement.RUNSee the “SAVEHIST Command”(page 101).Saves the s
SyntaxDescriptionCommandSee the “SHOW MVGROUPSCommand” (page 116).Displays all or a set of thematerialized view groups in thecurrent schema of the Neo
script-fileis the name of an ASCII text file that contains SQL statements, NeoviewScript interface commands, and comments. If the script file exists o
SQL>/(EXPR) -------------------- 62 --- 1 row(s) selected.SQL>CLEAR CommandThe CLEAR command clears the interfac
If Neoview Script was invoked with the -noconnect launch parameter, Neoview Script promptsyou for the values.Currently, none of the commands work with
ENV CommandENV displays attributes of the current Neoview Script session. You can also use the SESSIONand SHOW SESSION commands to perform the same fu
Current setting (on or off) of the elapsed time. By default, the elapsed time is off.For more information, see “Displaying the Elapsed Time” (page 54)
error-codeis an integer that represents an error condition of the previously executedcommand. If the previously executed command returns this error co
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• You cannot ex
SQL>select * from persnl.employee;...Pressing Enter executes the corrected SELECT statement.• Correct an SQL statement that you entered incorrectl
SHOW SQLTERMINATOR Command...124Syntax...
SQL>where jobcode=450;...Pressing Enter lists the employee number and last names of all employees whose job codeis 450:EMPNUM LAST_NAME
SyntaxHISTORY [number]numberis the number of commands to display. The default number is 10. The maximumnumber is 100.Considerations• In the Neoview Sc
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• Use a unique
• MODE and SHOW MODE• SET COLSEP and SHOW COLSEP• SET HISTOPT and SHOW HISTOPT• SET IDLETIMEOUT and SHOW IDLETIMEOUT• SET MARKUP and SHOW MARKUP• SET
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• Put a space b
+> CNO VARCHAR(3) NOT NULL,+> CNAME VARCHAR(22) NOT NULL,+> CDESCP VARCHAR(25) NOT NULL, +> CRED INT,+
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• You can execu
Total connections ...5 Total connection failures...0You can execute this command only in SQL mode.
log c:\errorCode.logselect * from employee;quit if errorcode=4082log offThese results are logged when error code 4082 occurs:SQL>select * from empl
Considerations• In the Neoview Script interface, you must enter the command on one line. The commanddoes not require an SQL terminator.• To reexecute
Comentários a estes Manuais