SQL*Plus User's Guide and Reference
Release 8.1.5

A66736-01

Library

Product

Contents

Index

Prev Up Next

Command Reference, 43 of 52


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 file named DIARY using the default file extension, enter

SQL> SPOOL DIARY

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

SQL> SPOOL OUT

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index