Skip Headers

Oracle9i OLAP Developer's Guide to the OLAP DML
Release 2 (9.2)

Part Number A95298-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Developing Programs, 8 of 12


Directing Output

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.

The 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 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.

If you are working in OLAP Worksheet, the default outfile is its response window. The current destination is called the current outfile.

Example 7-11 Directing Output to a File

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.

OUTFILE 'userfiles/yearend.txt'
year.end.sales
OUTFILE EOF

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.

OUTFILE APPEND 'userfiles/yearend.txt'
year.end.expenses
OUTFILE EOF

Capturing Error Messages

You can capture error messages by setting the ECHOPROMPT option to YES.

ECHOPROMPT = YES

When you set ECHOPROMPT to YES, input lines and error messages are echoed, as well as output lines, to the current outfile. If you use the OUTFILE or 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 PUSH and POP commands.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback