SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

SPOOL

Purpose

Stores query results in an operating system file and, optionally, sends the file to a printer.

Syntax

SPO[OL] [file_name[.ext]|OFF|OUT]

Terms and Clauses

Refer to the following list for a description of each term or clause:

file_name[.ext] Represents the name of the file to which you wish to spool. SPOOL followed by file_name begins spooling displayed output to the named file. If you do not specify an extension, SPOOL uses a default extension (LST or LIS on most systems).
OFF Stops spooling.
OUT Stops spooling and sends the file to your host computer's standard (default) printer.
Enter SPOOL with no clauses to list the current spooling status.

Usage Notes

To spool output generated by commands in a command file without displaying the output on the screen, use SET TERMOUT OFF. SET TERMOUT OFF does not affect output from commands run interactively.

Examples

To record your displayed output in a filenamed DIARY using the default file extension, enter

SQL> SPOOL DIARY

To stop spooling and print the file on your default printer, type

SQL> SPOOL OUT


Contents Index Home Previous Next