Slide 14.2: Using SQL*Plus: the Oracle interface
  Slide 14.4: Using SQL*Plus: the Oracle interface (cont.)
  Home


Using SQL*Plus: the Oracle Interface (Cont.)


edit [ filename ]
EDIT invokes a line editor on the contents of the specified file or on the contents of the buffer.
   SQL> edit
     2  q
‘;’, run, or ‘/’
Lists and executes the SQL command or PL/SQL block currently in the SQL buffer. ‘;’ and ‘/’ do not list the command.
   SQL> select * from customers
     2    where name = 'Pokemon';
@filename
Executes SQL statements stored in a host operating system file named.

get filename
GET loads a host operating system file into the SQL buffer.

save filename
SAVE stores the SQL buffer's contents in a host operating system file.

host command
HOST executes a host operating system command without leaving SQL*Plus.
   SQL> host date
   Wed Feb 11 09:54:03 CST 2004
   SQL> host sh exer1
spool [ file_name|OFF|OUT ]
Stores query results in an operating system file.
   SQL> spool results.lst
   SQL> select * from customers;
   SQL> spool off
   SQL> host cat results.lst