OUTPUT

From InterBase
Jump to: navigation, search

Go Up to isql Command Reference


Redirects output to the named file or to standard output.

OUTPUT [filename];
Argument Description

<filename>

Name of the file in which to save output; if no file name is given, results appear on the standard output

Description: 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.

Using OUTPUT <filename> from within an isql session has the same effect as using the option -output 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 OUTPUT statements.

Example: The following example stores the results of one SELECT statement in the file, sales.out. Normal output processing resumes after the SELECT statement.

OUTPUT sales.out;
SELECT * FROM SALES;
OUTPUT;

See Also