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

Running SQL Statements
In NCI, you can run SQL statements interactively. NCI supports all the SQL statements, SQL
utilities, and other SQL-related commands that the Neoview database engine supports. For more
information about those SQL statements, see the Neoview SQL Reference Manual. For SQL statements
that are available only to HP Support, see the Neoview Database Support Guide.
This subsection shows examples of:
“Executing an SQL Statement” (page 53)
“Repeating an SQL Statement” (page 53)
“Preparing and Executing SQL Statements” (page 54)
“Executing CREATE TRIGGER Statements” (page 57)
To run SQL statements from script files in NCI, see Chapter 5 (page 61).
Executing an SQL Statement
For example, you can query the EMPLOYEE table and return an employee’s salary by executing
this SELECT statement in NCI:
SQL>select salary
+>from persnl.employee
+>where jobcode=100;
SALARY
----------
175500.00
137000.10
139400.00
138000.40
75000.00
90000.00
118000.00
80000.00
70000.00
90000.00
56000.00
--- 11 row(s) selected.
SQL>
If the SQL statement executes successfully, NCI returns a message indicating that the SQL
operation was successful, followed by the standard prompt. If a problem occurs during the
execution of the SQL statement, NCI returns an error message. For information about error
messages, see the Neoview Messages Manual.
Repeating an SQL Statement
To run a previously executed SQL statement, use the /, RUN, or REPEAT command.
SQL>/
SALARY
----------
175500.00
137000.10
139400.00
138000.40
75000.00
90000.00
118000.00
80000.00
70000.00
Running SQL Statements 53