OUTPUT Statement [Interactive SQL]

Writes the information retrieved by the current query to a file.

Syntax

OUTPUT TO filenameAPPEND ] [ VERBOSE ]
   [ FORMAT output-format ] 
   [ ESCAPE CHARACTER character ] 
   [ DELIMITED BY string ] 
   [ QUOTE stringALL ] ] 
   [ COLUMN WIDTHSinteger, … ) ]
   [ HEXADECIMALON | OFF | ASIS } ]
   [ ENCODING encoding ]
   [ WITH COLUMN NAMES  ]

output-format:
   TEXT | FIXED | HTML | SQL | XML

Parameters

Examples

Usage

The current query is the SELECT or LOAD TABLE statement that generated the information that appears on the Results tab in the Results pane. The OUTPUT statement reports an error if there is no current query.

Note: OUTPUT is especially useful in making the results of a query or report available to another application, but is not recommended for bulk operations. For high-volume data movement, use the ASCII and BINARY data extraction functionality with the SELECT statement. The extraction functionality provides much better performance for large-scale data movement, and creates an output file you can use for loads.
Side Effects
  • In Interactive SQL, the Results tab displays only the results of the current query. All previous query results are replaced with the current query results.

Standards

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not applicable.

Permissions

None