- Declared In:
- MCPResultPlus.h
$Id: MCPResultPlus.m,v 1.1 2003/10/11 18:48:07 sergecohen Exp $
This Category is provided to get shortcuts reformat the table obtained by a MCPResult (fetching a column, a 2D array...).
Getting a complete column as an arrayGetting the complete result as 2D array
- - fetchColAtIndex:
- - fetchColWithName:
- - fetch2DResultAsType:
- (id)fetch2DResultAsType:(MCPReturnType)aType
Returns the complete result table in a 2D object, which type depends on aType:
- MCPTypeArray
: a NSArray of rows as NSArray,
- MCPTypeDictionary
: a NSArray of rows as NSDictionary,
- MCPTypeFlippedArray
: a NSArray of columns (as NSArray),
- MCPTypeFlippedDictionary
: a NSDictionary of columns (as NSArray)
In any case the read position is restored at the end of the call (hence a fetchRow will get the same row wether this method is called before it or not).
- (NSArray *)fetchColAtIndex:(unsigned int)aCol
Getting a complete column into a NSArray (1D). The index starts from 0 (first column).
The index 0 of the returned array always correspond to the first row (ie: returned NSArray is indexed by row number), the read position is restored after to it's initial position after the read.
- (NSArray *)fetchColWithName:(NSString *)aColName
The same as fetchColAtIndex:
, but the choice of the column is done by it's field name. Indeed it is just a wrapper to fetchColAtIndex
.