|Oracle9i OLAP Services Developer's Guide to the OLAP DML
Release 1 (9.0.1)
Part Number A86720-01
Designing Programs, 9 of 13
To send output to a file, use the OUTFILE command followed by a file name. A file will be created with that name. The file name that you specify must follow the standard filename format for your operating system.
The OUTFILE command changes the routing for all subsequent output. Therefore, if you route a report to a file, then you should reroute output to the default outfile before leaving the program. If you want to send subsequent output to the default outfile, then place the OUTFILE EOF command directly after your report commands. To make sure the OUTFILE EOF command is executed when errors cause abnormal termination of the program, also place the command in the abnormal exit section.
Suppose you have a program called YEAR.END.SALES, and you want to save the report it creates in a file. Type the following commands to write a file of the report in the working directory of your analytic workspace. You can specify a full path name when you want to use a different drive or directory.
Now the file contains the YEAR.END.SALES report. You can add more reports to the same file with the APPEND keyword for OUTFILE. Suppose you have another program called YEAR.END.EXPENSES. Add its report to the file with the following commands. Note that without APPEND, the OUTFILE command overwrites the expense report.
You can route error messages to a file by setting the ECHOPROMPT option to YES.
When you set ECHOPROMPT to YES, input lines and error messages are echoed, as well as output lines, to the current outfile.
The next topic explains that you can use the DBGOUTFILE command to create a log, or debugging file, of your program's execution. When you create a debugging file and set ECHOPROMPT to YES, input lines and error messages are routed to the debugging file instead of to the current outfile.
If you set ECHOPROMPT to YES, then remember to save and restore its original value with the PUSH and POP commands.
Paging options such as BMARGIN and LSIZE have separate values for the default outfile and for files. Executing the OUTFILE command sets the paging options to their current values for the specified output destination. To make sure the paging options have the values you want, set them after executing the OUTFILE command.
When you set paging options for the default outfile, the new values remain in effect until you reset them. However, when you set paging options for a file, the new values remain in effect only as long as you continue sending output to the same file. When an OUTFILE command that routes output to a different destination is executed, including a different file, the paging options return to their default values for files.
Therefore, if you want the paging options to have a particular value for a file, then you must reset the options each time you use the OUTFILE command for the file.
For more information, see the following table.
|IF you want documentation about . . .||THEN see . . .|
creating a debugging file and debugging with files,
individual OLAP DML commands,
the topic for the command in OLAP DML Reference