| Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
You can invoke a program that does not return a value by using the CALL command. You enclose arguments in parentheses, and they are passed by value.
For example, suppose you create a simple program named addit to add two integers. You can use the CALL command in the main program of your application to invoke the program.
CALL addit (3, 4)
You can also invoke programs in much the same way as you issue OLAP DML statements. In this case, for a program that does not return a value, you merely use the program name as you would an OLAP DML command. If the OLAP DML program returns a value then it is a user-defined function. You invoke user-defined functions in the same way as you use built-in functions. You merely use the program name in an expression and enclose the program arguments, if any, in parentheses.
For example:
You can use the program name as an expression in a command.
The following REPORT command uses the value that is returned by the user-defined function isrecent that has a single argument, actual.
REPORT isrecent(actual)
You can use SET to assign the return value of the function to a variable.
The following command assigns the return value of the user-defined function named tempsales to a temporary variable called mytempsales.
mytempsales = tempsales
|
Note: Although you can also run user-defined functions using the CALL command, you do not have access to the return value. |
You can also create programs that execute automatically when a user attaches an analytic workspace as described in "Startup Programs".