Oracle® OLAP DML Reference 11g Release 1 (11.1) Part Number B28126-01 |
|
|
View PDF |
The OLAP DML is a multidimensional language. This means that operations in the OLAP DML apply all at once to an entire set of values. Again, conceptually, you can think of these operations as applying to the values in all of the cells in a variable; or, physically, you can think of these operations as applying to all of the elements in the array that is the variable. Consequently, using the OLAP DML assignment statement (that is, SET or =), you do not need to code explicit loops to assign values to all of the elements in a variable. Instead, when you issue a statement against an object that has one or more dimensions, the statement loops over the values in status for each dimension of the object and performs the requested operation.
Assume, for example, that there is a dimension named prodid
that has three values, Prod01
, Prod02
, and Prod03
, and you have a variable named quantity
that is dimensioned by prodid. As the following code snippet illustrates, if Prod01
, Prod02
, and Prod03
are all in status, when you assign the value 3
to quantity, Oracle OLAP assigns the value 3
to all of the elements in quantity.
quantity = 3 REPORT quantity PRODID QUANTITY -------------- ---------- PROD01 3.00 PROD02 3.00 PROD03 3.00
Other OLAP DML statements (for example, REPORT, ROW, and FOR) also loop through all of the in status elements of a dimensioned object when they execute.
By default, statements loop through the values of a dimensioned object using the order in which the dimensions of the object are listed in the definition of the object. Also, when a variable is dimensioned by a composite, most looping statements loop through the variable as though it was not dimensioned by a composite, but was, instead, dimensioned by the base dimensions of the composite.
The OLAP DML provides ways for you to change the default looping behavior or to explicitly request looping:
ACROSS phrase—Some looping command (such as assignment statements that you use to assign values) have an ACROSS phrase that you can use to specify nondefault looping behavior. For detailed documentation of the ACROSS phrase, see the SET (=) command.
ACROSS command—When an OLAP DML statement is not a looping statement or does not include an ACROSS phrase, you can request looping behavior by coding the DML statement as an argument of the ACROSS command.