Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Designing Programs, 3 of 13
There are two ways that you can invoke an OLAP DML program that does not return a value:
call hello ('Hello World')
You typically use the CALL command to invoke a program when you are using an OLAP DML program that does not return values as a subprogram.
hello 'Hello World'
You typically invoke a program in this way when it is a standalone or main program.
The syntax for using the CALL command to invoke a program is shown below.
CALL program-name [(arg1 [arg2 ...])]
The program-name argument is the name of the program to be called.
The arg1 and arg2 arguments are optional and specify any arguments that are expected by the called program. You can declare these arguments in the called program with the ARGUMENT command, or you can reference them in the program with the ARG function. When the program uses the ARGUMENT command and you use the CALL command to invoke the program, specify the arguments so that they match the positions of the arguments that are declared in the called program.
For the complete syntax of the CALL command, see the entry for the command in OLAP DML Reference.
A user-defined function is a program that does not return a value. You invoke user-defined functions in the same way as you use OLAP DML built-in functions. You merely use the program's name in an expression and enclose the program's arguments, if any, in parentheses. The arguments are passed by value, not as text.
For example:
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)
The following command assigns the return value of the user-defined function named TEMPSALES to a temporary variable called MYTEMPSALES.
mytempsales = tempsales
Important: Although you can also run user-defined functions as standalone programs or invoke them using the CALL command, in these cases, the return value of the function is discarded.
For more information, see the following table.
IF you want documentation about . . . | THEN see . . . |
---|---|
using arguments, |
|
the CALL command, |
the entry for the command in OLAP DML Reference |
user-defined functions, |
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|