OUTPUT Statement [Interactive SQL]

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

Quick Links:

Go to Parameters

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

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

(back to top)

Examples

(back to top)

Usage

(back to top)

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

(back to top)

  • SQL—Vendor extension to ISO/ANSI SQL grammar.
  • SAP Sybase Database product—Not applicable.

Permissions

(back to top)

None