Neoview Command Interface (NCI) Guide (R2.3)
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 155).
This subsection shows examples of:
• “Executing an SQL Statement” (page 69)
• “Repeating an SQL Statement” (page 69)
• “Preparing and Executing SQL Statements” (page 70)
• “Executing CREATE TRIGGER Statements” (page 73)
To run SQL statements from script files in NCI, see Chapter 5 (page 77).
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 69