Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API Release 1 (9.0.1) Part Number A88756-01 |
|
Retrieving Query Results, 4 of 6
You can specify the following aspects of the behavior of a Cursor
.
Cursor
, which is the number of elements of the result set that the Cursor
retrieves during one fetch operation.
Cursor
. The fetch block is the set of elements of each descendent ValueCursor
that the parent CompoundCursor
retrieves. The shape of the fetch block is the levels of the CompoundCursor
at which you set the fetch sizes.
Cursor
. The extent is the total number of positions of the Cursor
. If the Cursor
is a child Cursor
of a CompoundCursor
, its extent is relative to any slower varying outputs.
Cursor
at which the value of a child Cursor
starts or ends.
To specify the behavior of Cursor
, you use methods on the CursorSpecification
for that Cursor
. To get the CursorSpecification
for a Cursor
, you use methods on the CursorManagerSpecification
that you create for a Source
.
Note: Specifying the calculation of the extent or the starting or ending position in a parent Cursor
of the current value of a child Cursor
can be a very expensive operation. The calculation can require considerable time and computing resources. You should only specify these calculations when your application needs them.
For more information on the relationships of Source
, Cursor
, CursorSpecification
, and CursorManagerSpecification
objects or the concepts of fetch size, extent, or Cursor
positions, see Chapter 10.
This example creates a Source
, creates a CursorManagerSpecification
for the Source
, and then gets the CursorSpecification
objects from a CursorManagerSpecification
. The root CursorSpecification
is the CursorSpecification
for the top-level CompoundCursor
.
Source salesAmountsForSelections = salesAmount.join(customerSel) .join(productSel); .join(timeSel); .join(channelSel); .join(promotionSel); try{ tp.prepareCurrentTransaction(); } catch(NotCommittableException e){ output.println("Caught exception " + e + "."); } tp.commitCurrentTransaction(); // Create a Cursor for salesAmountsForSelections CursorManagerSpecification cursorMngrSpec = dp.createCursorManagerSpecification(salesAmountsForSelections); // Get the root CursorSpecification of the CursorManagerSpecification. CompoundCursorSpecification rootCursorSpec = (CompoundCursorSpecification) cursorMngrSpec.getRootCursorSpecification(); // Get the CursorSpecification for the base values ValueCursorSpecification baseValueSpec = rootCursorSpec.getValueCursorSpecification(); // Get the CursorSpecification objects for the outputs List outputSpecs = rootCursorSpec.getOutputs(); ValueCursorSpecification promoSelValCSpec = (ValueCursorSpecification) outputSpecs.get(0); ValueCursorSpecification chanSelValCSpec = (ValueCursorSpecification) outputSpecs.get(1); ValueCursorSpecification timeSelValCSpec = (ValueCursorSpecification) outputSpecs.get(2); ValueCursorSpecification prodSelValCSpec = (ValueCursorSpecification) outputSpecs.get(3); ValueCursorSpecification custSelValCSpec = (ValueCursorSpecification) outputSpecs.get(4);
Once you have the CursorSpecification
objects, you can use their methods to specify the behavior of the Cursor
objects that correspond to them.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|