Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Using Embedded SQL, 11 of 15
When an output host variable is a dimension, retrieved values are handled based on the keyword that you specify before the host variable name. You can specify either the MATCH keyword (the default) or the APPEND keyword.
SQL FETCH cursor LOOP INTO [MATCH|APPEND] dimension
With the MATCH keyword, only values that are the same as existing values of the dimension are fetched, and an error is signalled when a new value is encountered. You use it when fetching data into a variable whose dimensions are already maintained; the dimensions are included in the fetch only to align the data.
In the following example, the MATCH keyword is omitted because it is the default value. The data in the PROD_ID column of the Products table corresponds to the PROD dimension values in the analytic workspace. An error is signalled when a value from the relational table does not match any value in the PROD dimension.
sql fetch highprice loop into :prod, :labels.p
With the APPEND keyword, all values that do not match are added to the list of dimension values.
APPEND has the following arguments, which you use to specify the position where the new values will be inserted. LAST is the default value.
AFTER value BEFORE value FIRST LAST
In the following example, the APPEND keyword allows new values to be added to the PROD dimension.
sql fetch highprice loop into :append prod, :labels.p
In the next example, new dimension values are added to the PROD dimension before the value P11.
sql fetch highprice loop into :append before 'P11' prod :labels.p
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|