Purpose:
This is the class that is used to represent a result set cursor for DD.
Methods:
BOOL isValid();
Returns true if cursor is valid. The cursor is valid if it is pointing to a data object or if it is positioned at the beginning, end or in between.
BOOL isOpen();
BOOL isBegin();
Return true if cursor is positioned at the beginning, i.e. positioned before the first data object in the result.
BOOL isEnd();
Return true if cursor is positioned at the end, i.e. positioned after the last data object in the result.
BOOL isInBetween();
Return true if cursor is positioned in between data objects in the result set. In other words, the cursor is not
at the beginning or at the end, and the current data object has not been fetched.
long getPosition();
setPosition(long repositionType, VARIANT value);
Sets the cursor to the specific position. The valid reposition types are:
DK_RELATIVE
setToNext();
Sets the cursor to point to the position of the next data object.
LPDISPATCH fetchObject();
Fetches the element of the result set at the current position and returns it as a DXDDODD. The returned LPDISPATCH pointer contains a DXDDODD object.
LPDISPATCH fetchNext();
Fetches the next element of the result set and returns it as a DXDDODD. The returned LPDISPATCH pointer contains a DXDDODD object.
BOOL fetchNextN(long how_many, LPDISPATCH collection);
Fetch next N elements of the result set and insert them into the given collection. Returns true if there is at least one data object returned. The input parameter LPDISPATCH pointer contains a DXSequentialCollectionDD object.
VARIANT fetchObjectByName(LPCTSTR dataItemName);
VARIANT fetchNextByName(LPCTSTR dataItemName);
BOOL fetchNextNByName(LPCTSTR dataItemName, long how_many, VARIANT* array, long arraySize);
Fetch values of the the next n data objects by data item name and insert them into the given array. The size of array and how_many input parameter determine how many values are put into the array. Returns true if there is at least one value returned.
LPDISPATCH findObject(long position, LPCTSTR predicate);
Find the data object which satisfies the given predicate, move the cursor to that position, fetch and return the data object. The returned LPDISPATCH pointer contains a DXDDODD object.
The format of the predicate string is AttrName RelOp Value where RelOp are relational operators such as = or ==, <=, >=, <, >,
open();
close();
destroy();
Destroy the result set cursor. This method allows for cleanup.
BSTR datastoreName();
BSTR datastoreType();
long cardinality();
BOOL isScrollable();
BOOL isUpdatable();
setToPrevious();
Sets cursor to point to the position of the previous data object in the cursor.
LPDISPATCH fetchPrevious();
Sets cursor to point to the position of the previous data object and fetches the element in the cursor at that position.
LPDISPATCH fetchFirst();
Sets cursor to point to the position of the first data object and fetches the element in the cursor at that position.
LPDISPATCH fetchLast();
Sets cursor to point to the position of the last data object and fetches the element in the cursor at that position.
BOOL fetchPreviousN(long how_many, LPDISPATCH collection);
Fetches the previous N elements of the cursor and inserts them into the given collection. how_many -- how many elements the user wants to be returned in the collection. collection -- the collection where elements that are fetched are stored. Returns true if there is at least one data object returned.
VARIANT fetchPreviousByName(LPCTSTR dataItemName);
Sets cursor to point to the position of the previous data object and fetches the data item value in the cursor at that position by data item name.
BOOL fetchPreviousNByName(LPCTSTR dataItemName, long how_many, VARIANT FAR* array, long arraySize);
Fetches the previous N data item values of the cursor and inserts them into the given array. dataItemName -- data item name. how_many -- how many data item values the user wants to be returned in the collection. array -- the array where the data item values that are fetched are stored. Returns true if there is at least one data item value returned.
(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.