Go Up to isql Command Reference
Redirects output to the named file or to standard output.
Name of the file in which to save output; if no file name is given, results appear on the standard output
OUTPUT determines where the results of
isql commands are displayed. By default, results are displayed on standard output (usually a screen). To store results in a file, supply a <filename> argument. To return to the default mode, again displaying results on the standard output, use
OUTPUT without specifying a file name.
By default, only data is redirected. Interactive commands are not redirected unless
SET ECHO is in effect. If
SET ECHO is in effect,
isql displays each command before it is executed. In this way,
isql captures both the results and the command that produced them.
SET ECHO is useful for displaying the text of a query immediately before the results.
- Note: Error messages cannot be redirected to an output file.
OUTPUT <filename> from within an
isql session has the same effect as using the option -
filename from the command line.
You can optionally delimit the filename with double or single quotes. This allows you to use filenames with spaces in
Example: The following example stores the results of one
SELECT statement in the file,
sales.out. Normal output processing resumes after the
OUTPUT sales.out; SELECT * FROM SALES; OUTPUT;