|Oracle9i OLAP Developer's Guide to the OLAP DML
Release 2 (9.2)
Part Number A95298-01
Developing Programs, 8 of 12
To send output to a file, use the
OUTFILE command followed by a directory alias and a file name, and separatae the two with a slash (/). A file will be created with the name you specify. Before you execute the
OUTFILE command, you can use the
CDA command to specify a current directory alias. In this case, you do not have to specify a directory alias in the
OUTFILE command because Oracle OLAP assumes that you want the file to be created in your current directory alias.
Directory aliases are defined in the database and control access to directories. Contact your Oracle DBA for the name of a directory alias to which your database user name has read/write access. The file name that you specify must follow the standard filename format for your operating system.
OUTFILE command changes the routing for all subsequent output. Therefore, if your program routes 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
EOF command directly after your report commands. To make sure the
EOF command is executed when errors cause abnormal termination of the program, also place the command in the abnormal exit section.
If you are working in OLAP Worksheet, the default outfile is its response window. The current destination is called the current outfile.
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 this example,
userfiles is a directory alias and
yearend.txt is the name of the file.
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
OUTFILE command overwrites the expense report.
You can capture error messages by setting the
ECHOPROMPT option to
When you set
YES, input lines and error messages are echoed, as well as output lines, to the current outfile. If you use the
DBGOUTFILE command, you can capture the error messages in a file. For information about
DBGOUTFILE, see "Sending Output to a Debugging File".
Whenever you change a setting, remember to save and restore its original value with the