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, 12 of 13


Compiling Programs

When a program is compiled

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 after you have edited it.

Example: Using the COMPILE command

The following is an example of a COMPILE command that compiles the MYPROG program.

compile myprog

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

Example: Compilation errors

Suppose you misspell the dimension MONTH in a LIMIT command in the MYPROG program.

limit motnh to last 6

When the COMPILE command encounters this command, it produces the following message.

ERROR: MOTNH does not exist in any attached database.
In MYPROG PROGRAM:
limit motnh to last 6
     ^

You can edit the program to correct the error and then try to compile it again.

How a program is compiled

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.

Note: Program lines that include ampersand substitution will not be compiled. However, the presence of such lines does not constitute an error. A program whose other lines compiled correctly is considered to be a compiled program.

Compiling and updating

After you compile a program, the compiled code is used each time you run the program in the current OLAP Services session. When you update your analytic workspace after compiling a program, the compiled code is saved in your analytic workspace and uses it when you run the program in future sessions. Therefore, you should be sure to update your analytic workspace after compiling a program.

Compiling, exporting, and importing

After you export a program from a source analytic workspace, if you import the program to a target analytic workspace, then the compiled code is not exported or imported. Therefore, after you import a program to a target analytic workspace, you need to compile the program and update the target analytic workspace.

To keep an application analytic workspace compact and uncluttered, application builders often define and test objects in a test analytic workspace, and then import the tested objects to the final analytic workspace. When you follow this procedure, remember to compile your programs in the final analytic workspace.

Compiling with object definitions

When your program defines an object and then uses the object in the program, the program will not compile. When COMPILE encounters the reference to the object, it treats the reference as a misspelling because the object does not yet exist in the analytic workspace.

Finding out if a program has been compiled

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.

show obj(iscompiled 'myprogram')

For the syntax of the OBJ function, see the entry for the function in OLAP DML Reference.


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