Redirect query results

The output from a SELECT statement is normally displayed on the screen. You can use the Output option on the SQL menu to route query results to the printer, store them in a system file, or pipe them to a program. The Output option has the same result as the OUTPUT statement of SQL.

The SELECT statement must be on the screen as the current statement. Select the Output option from the SQL menu, which displays the OUTPUT menu.

You have the following output options:

  • Send your query results directly to a printer. DB-Access sends the results to your default printer and displays a message on the bottom of the screen that indicates how many rows were retrieved. The query results do not show on the screen. You can set the DBPRINT environment variable to specify a default printer.
  • Write query results to a new file or append the results to an existing file. If you do not specify a path when DB-Access prompts you for a file name, the file is stored in the directory that you were in when you started DB-Access.
  • Send query results to a pipe. Specify a target program, such as more, through which to pipe output. DB-Access sends the results to that pipe.

    On UNIX systems, you must have permission to run the target program.

    On Windows systems, the cat utility can serve as a target program through which to pipe output.

Copyright© 2019 HCL Technologies Limited