Spool options

Today I just reviewed the spool options provided by Oracle SQLPLUS.

SP2-0108: The filenames CREATE, REPLACE, APPEND, FILE, and abbreviations may not be used.
SP2-0769: Usage: SPOOL { <file> | OFF | OUT }
where <file> is file_name[.ext] [CRE[ATE]|REP[LACE]|APP[END]]

Basically CREATE has no difference with REPLACE. APPEND will just help append your result to an existing report.

For example, “spool a.txt append” will spool the results to the existing report a.txt.

 

Terms

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). The extension is not appended to system files such as /dev/null and /dev/stderr.

CRE[ATE]

Creates a new file with the name specified.

REP[LACE]

Replaces the contents of an existing file. If the file does not exist, REPLACE creates the file. This is the default behavior.

APP[END]

Adds the contents of the buffer to the end of the file you specify.

OFF

Stops spooling.

OUT

Stops spooling and sends the file to your computer’s standard (default) printer. This option is not available on some operating systems.

Enter SPOOL with no clauses to list the current spooling status.

More details, http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12043.htm