| Oracle9i OLAP Developer's Guide to the OLAP API Release 2 (9.2) Part Number A95297-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.
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 8.
Example 9-9 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 © 2000, 2002 Oracle Corporation. All Rights Reserved. |
|