Oracle SQL - Spooling a SQL*Plus Session


You can record the complete results of a SQL*Plus session in an operating system file, using the SQL*Plus SPOOL command.

SQL> spool all_results.TXT [create|replace|append]
SQL> select * from emp;
SQL> select * from departments;
SQL> spool off

ALL_RESULTS.TXT file, created in the same directory or folder where the SAVE command stores its script files.

It would contain a complete copy of all screen output.

You can use one of the following keywords: CREATE, REPLACE, or APPEND.

With these three options, you can specify which behavior to use for the an existing file.

Related Topics