Oracle9i OLAP Services Developer's Guide to the OLAP DML
Release 1 (9.0.1)

Part Number A86720-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

Designing Programs, 13 of 13


Testing Programs

Testing a program by running it

Even when your program compiles cleanly, you must also test the program by running it. Running a program helps you detect errors in commands with ampersand substitution, errors in logic, and errors in any nested programs.

To test a program by running it, use a full set of test data that is typical of the data that the program will process. To confirm that you test all the features of the program, including error-handling mechanisms, run the program several times, using different data and responses. Use test data that:

Using SHOW commands

Each time you run the program, confirm that the program executes its commands in the correct sequence and that the output is correct. As an aid in analyzing the execution of your program, you can include SHOW commands in the program to produce diagnostic or status messages. Then delete the SHOW commands after your tests are complete.

When you detect or suspect an error in your program or a nested program, you can track down the error by using the debugging techniques that are described in the next section.

For the syntax of the SHOW command, see the entry for the command in OLAP DML Reference.

Using the BADLINE option

When you set the BADLINE option to YES, additional information will be produced, along with any error message when a bad line of code is encountered. When the error occurs, the error message, the name of the program, and the program line that triggered the error are sent to the current outfile.

You can edit the specified program to correct the error and then run the original program.

For the syntax of the BADLINE option, see the entry for the option in OLAP DML Reference.

Example: Using the BADLINE option

In a simple program called TEST, the variable MYINT1 is divided by zero.

DEFINE TEST PROGRAM
PROGRAM
variable myint1 integer
variable myint2 integer
myint1 = 0
myint2 = 250/myint1
END

If you run the program when the DIVIDEBYZERO option is set to NO, then an error occurs because division by zero is not allowed. When BADLINE is set to YES, the following messages are recorded in the current outfile.

ERROR: (MXXEQ01) A division by zero was attempted.  (If you want NA to be 
returned as the result of a division by zero, set the DIVIDEBYZERO option to 
YES.)
In TEST PROGRAM:
myint2 = 250/myint1

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, 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