Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
Within the general category of programming, the OLAP DML statements can be grouped into the following subcategories:
Handling programs
Statements that are only used in programs
Statements that are primarily used in programs
Debugging programs
Creating and managing trigger programs
Additionally, you often use statements for forecasts, regression, reporting, importing and exporting data, embedding SQL within an OLAP DML program, and triggering the execution of programs when a particular OLAP DML program executes. For tables outlining these statements see "Forecast and Regression Statements" and "File Reading and Writing Statements", "Statements for Importing and Exporting Data", "Reporting Statements", and "Statements for Working with Startup and Trigger Programs".
Table A-22, "Statements for Handling Programs" lists the OLAP DML statements that you use to hide, compile, and call programs.
Table A-22 Statements for Handling Programs
Statement | Description |
---|---|
ALLCOMPILE |
Compiles every compilable object in your current analytic workspace, one at a time. |
CALL |
Invokes an OLAP DML program, and, when the program has arguments, passes these arguments to the called program. |
COMPILE |
Generates compiled code for a compilable object, such as an OLAP DML program, formula, model, or aggmap without running it and saves the compiled code in the analytic workspace. |
DEFINE PROGRAM |
Creates a new program object. |
PROGRAM |
Assigns contents to the most recently defined or considered OLAP DML program. |
HIDE |
Hides the text of a program, so that you cannot display it using the DESCRIBE command, the EDIT command, or the OBJ function. You can perform all other actions on the program, including executing, compiling, renaming, or exporting. |
UNHIDE |
Unhides the text of a program that has been made invisible by using the HIDE command. |
Table A-23, "Statements Used Only in OLAP DML Programs" lists the OLAP DML statements that you can use only within the contents of an OLAP DML program.
Table A-23 Statements Used Only in OLAP DML Programs
Statement | Description |
---|---|
ARG |
Lets you reference arguments passed to a program by returning one argument as a text value. |
ARGCOUNT |
Returns the number of arguments that were specified when the current program was invoked. |
ARGFR |
Lets you reference the arguments that are passed to a program by returning a group of one or more arguments, beginning with the specified argument number, as a single text value. |
ARGS |
Lets you reference the arguments that are passed to a program by returning all the arguments as a single text value. |
ARGUMENT |
Declares an argument that is expected by a program. |
BREAK |
Transfers program control from within a SWITCH, FOR, or WHILE statement to the statement immediately following the DOEND associated with SWITCH, FOR, or WHILE. |
CALLTYPE |
Returns a value that Indicates whether a program was invoked as a function, as a command, or by using the CALL command. |
CONTINUE |
Transfers program control to the end of a FOR or WHILE loop (just before the DO/DOEND statement), allowing the loop to repeat. You can use CONTINUE only within programs and only with FOR or WHILE. |
DO ... DOENDs | Brackets a group of one or more statements. DO and DOEND are normally used to bracket a group of statements that are to be executed under a condition specified by an IF statement, a group of statements in a repeating loop introduced by FOR or WHILE, or the CASE labels for a SWITCH statement. |
FOR |
Specifies one or more dimensions whose status will control the repetition of one or more statements. |
GOTO |
Alters the sequence of statement execution within the program by indicating the next program statement to execute. |
IF...THEN...ELSE |
Executes one or more statements in a program if a specified condition is met. Optionally, it also executes an alternative statement or group of statements when the condition is not met. |
RETURN |
Terminates execution of a program prior to its last line. You can optionally specify a value that the program will return. |
SIGNAL |
Produces an error message and halts normal execution of the program. When the program contains an active trap label, execution branches to the label. Without a trap label, execution of the program terminates and, if the program was called by another program, execution control returns to the calling program. |
SWITCH |
Provides a multipath branch in a program. The specific path taken during program execution depends on the value of the control expression that is specified with SWITCH. |
TEMPSTAT |
Limits the dimension you are looping over, inside a FOR loop or inside a loop that is generated by the REPORT command. Status is restored after the statement following TEMPSTAT. If a DO ... DOEND phrase follows TEMPSTAT, status is restored when the matched DOEND or a BREAK or GOTO statement is encountered. |
TRAP |
Causes program execution to branch to a label when an error occurs in a program or when the user interrupts the program. When execution branches to the trap label, that label is deactivated. |
VARIABLE |
Declares a local variable or valueset for use within a program. A local variable cannot have any dimensions and exists only while the program is running. |
WHILE |
Repeatedly executes a statement while the value of a Boolean expression remains TRUE. |
END |
Marks the end of the program contents. |
Table A-24, "Statements Used Primarily in OLAP DML Programs" lists the OLAP DML statements that are used primarily in OLAP DML programs.
Table A-24 Statements Used Primarily in OLAP DML Programs
Statement | Description |
---|---|
ACROSS |
Specifies a text expression that contains one or more statements to be executed in a loop. |
CONTEXT command |
Lets you create and use a context during your Oracle OLAP session. A context is a means of preserving object values. After you create a context, you can save the current status of dimensions and the values of options, single-cell variables, valuesets, and single-cell relations in the context. You can then restore some or all of the object values from the context. |
CONTEXT function |
Obtains information about object values that are saved in a context. You must first create the context with the CONTEXT command. |
INFO (PARSE) | Obtains information that has been produced by the PARSE command. |
PARSE |
Parses a specified group of expressions. |
POP |
Restores the status of a dimension, the status of a valueset, or the value of an option or single-cell variable that was saved with a previous PUSH command. |
POPLEVEL |
Restores all values saved with PUSH commands that were executed since the last POPLEVEL command specifying the same marker. |
PUSH |
Saves the current status of a dimension, the status of a valueset, or the value of an option or single-cell variable. |
PUSHLEVEL |
Marks the start of a series of PUSH commands. |
SLEEP |
Suspends the operation of Oracle OLAP for at least the specified number of seconds. |
Table A-25, "OLAP DML Program Debugging Statements" lists the OLAP DML statements that you use to debug OLAP DML programs.
Table A-25 OLAP DML Program Debugging Statements
Statement | Description |
---|---|
BACK |
Returns the names of all currently executing programs, listed one a line in a multiline text value. |
DBGOUTFILE |
Sends debugging information to a file. |
MONITOR |
Records data on the performance cost of each line in a specified OLAP DML program. |
TRACKPRG |
Tracks the performance cost of every OLAP DML program that runs while you have tracking turned on. |
Trigger programs and startup programs are programs that Oracle OLAP automatically executes when a particular OLAP DML statement executes. Table A-26, "Statements for Working with Startup and Trigger Programs" lists the OLAP DML statements that you can use to create and manage trigger programs.
Table A-26 Statements for Working with Startup and Trigger Programs
Statement | Description |
---|---|
CALLTYPE |
Within an OLAP DML program, the CALLTYPE function indicates whether a program was invoked as a function, as a command, by using the CALL command, or triggered by the execution of an OLAP DML statement. |
ONATTACH |
A program that you create and that Oracle OLAP checks for by name when an AW ATTACH statement executes. Depending on the value returned by the program, Oracle OLAP executes the code within the program immediately after attaching the analytic workspace. |
PERMIT_READ |
A program that you create and that Oracle OLAP checks for by name when an AW ATTACH read-only statement executes. Depending on the value returned by the program, Oracle OLAP executes the code within the program after attaching the analytic workspace. |
PERMIT_WRITE |
A program that you create and that Oracle OLAP checks for by name when an AW ATTACH read/write statement executes. Depending on the value returned by the program, Oracle OLAP executes the code within the program after attaching the analytic workspace. |
TRIGGER command | Associates a previously-created program to a previously-defined object and identifies the object event that automatically executes the program; or a disassociates a trigger program from the object. |
TRIGGER function |
Retrieves the event, subevent, or name of the object or analytic workspace that caused the execution of a TRIGGER_DEFINE program, a TRIGGER_DEFINE program, or any programs identified as triggers using the TRIGGER command. |
TRIGGER_AFTER_UPDATE |
A program that you create and that Oracle OLAP checks for by name when an UPDATE statement executes. When the program exists, Oracle OLAP executes the program after the UDPATE occurs. |
TRIGGER_BEFORE_UPDATE |
A program that you create and that Oracle OLAP checks for by name when an UPDATE statement executes. When the program exists, Oracle OLAP executes the program and then, depending on the value returned by the program (if any), either does nor does not update the workspace. |
TRIGGER_DEFINE |
A program that you create and that Oracle OLAP checks for by name when a DEFINE statement executes. When the program exists, Oracle OLAP executes the program and then, depending on the value returned by the program (if any), either does nor does not define the object. |
TRIGGERASSIGN |
Typically used in trigger program for an Assign event, the TRIGGERASSIGN statement replaces one assigned value. |