IBM Books

Administration Guide


Result Destinations

Normally, the database stores query results as tables. The Result Destinations table contains the descriptions of any available alternative destinations for query results. These alternative destinations can designate that the results should be written to a file or piped to a process. If written to a file or pipe, the results are output in comma-separated variable format.

When the results are to be written to a file, the destination description designates the file name. When the results are to be piped, the description designates the name of the executable to which the results will be piped, along with any command-line parameters.

Result Destination Variables

For either files or piped destinations, the description can contain the following variables. The run-time values replace these variables before the query executes.

Piped Result Destinations

The pipe process can be a shell script or any other executable. DB2 Query Patroller invokes this process under the job owner's user ID, but with the environment variables set as they were when agent started. The process can read the results from STDIN unless the system administrator specifies the $(PIPE) variable symbol in the result destination description, in which case it can be read from a named pipe created by the DB2 Query Patroller SQL executor. If the process terminates before reading all of the results, the job aborts. To create a result file on the machine named "remote", you can use the following destination description:

rsh remote "cat > job$(JOB)_results"


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]