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

Running SQL Statements
In the NCI, you can run SQL statements interactively. For a list of SQL statements that you can
run interactively, see Appendix B (page 159).
This subsection shows examples of:
“Executing an SQL Statement” (page 67)
“Repeating an SQL Statement” (page 67)
“Preparing and Executing SQL Statements” (page 68)
“Executing CREATE TRIGGER Statements” (page 71)
To run SQL statements from script files in NCI, see Chapter 5 (page 75).
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
90000.00
56000.00
Running SQL Statements 67