|Oracle9i OLAP Developer's Guide to the OLAP DML
Release 2 (9.2)
Part Number A95298-01
Developing Programs, 11 of 12
You can explicitly compile a program by using the
COMPILE command. If you do not explicitly compile a program, then it is compiled when you run the program for the first time.
When a program is compiled, it translates the program commands into efficient processed code that executes much more rapidly than the original text of the program. If errors are encountered in the program, then the compilation is not completed, and the program is considered to be uncompiled.
After you compile a program, the compiled code is used each time you run the program in the current session. When you update and commit your analytic workspace after compiling a program, the compiled code is saved in your analytic workspace and used to run the program in future sessions. Therefore, you should be sure to update and commit after compiling a program. This is particularly critical when the program is part of an application that is run by many users. Unless the compiled version of the program is saved in the analytic workspace, the program is recompiled individually in each user session.
The following is an example of a
COMPILE command that compiles the
Suppose you misspell the dimension
month in a
LIMIT command in the
COMPILE command encounters this command, it produces the following message.
ERROR: (MXMSERR00) Analytic workspace object MOTNH does not exist. In DEMO!MYPROG PROGRAM: limit motnh to last 6
You can edit the program to correct the error and then try to compile it again.
You can use the
ISCOMPILED choice of the
OBJ function to determine whether a specific program in your analytic workspace has been compiled since the last time it was modified. The function returns a Boolean value.
Program lines that include ampersand substitution will not be compiled. Any syntax errors will not be caught until the program is run. A program whose other lines compiled correctly is considered to be a compiled program.
When your program defines an object and then uses the object in the program, the program will not compile.
COMPILE treats the reference to the object as a misspelling because the object does not yet exist in the analytic workspace.
"Passing Arguments as Text with Ampersand Substitution" for information about ampersand substitution.