|Oracle® OLAP DML Reference
10g Release 1 (10.1)
Part Number B10339-02
Within an OLAP DML program, the CALLTYPE function indicates whether a program was invoked as a function, as a command, by using a CALL statement, or triggered by the execution of an OLAP DML statement.
The return value of CALLTYPE is either
CALL. CALLTYPE is for use only within programs.
The return value of CALLTYPE is:
FUNCTION when the program was invoked as a function that returns a value.
COMMAND when the program was invoked as a a command.
CALL when the program was invoked using a CALL statement.
TRIGGER when the program is a trigger program (that is, when a TRIGGER command associated the program with an object event) was invoked in response to a OLAP DML statement.
The CALLTYPE function is helpful when you want to find out how your program has been called, so that you can handle appropriately any arguments that have been passed. See ARGUMENT for information on the differences in argument handling that depend on how a program is invoked. See CALL for information on calling programs.
Example 8-36 Determining the Calling Method
This sample program, called
myprog, demonstrates how CALLTYPE returns different values depending on how the program is invoked.
DEFINE myprog PROGRAM PROGRAM SHOW CALLTYPE RETURN('This is the return value') END
The following statements invoke
myprog: 1) as command; 2) with a CALL statement; 3) as a function.
myprog CALL myprog SHOW myprog
The three statements send the following output to the current outfile. Note that the return value of myprog appears only when the program is called as a function.
COMMAND CALL FUNCTION This is the return value