DSIRowCountResult Class Reference

An implementation of IResult which represents row count results. More...

Inherits Simba::DSI::IResult.

Inherited by DSISimpleRowCountResult.

List of all members.

Public Member Functions

virtual simba_unsigned_native BulkFetch (simba_unsigned_native in_rowsetSize, const std::vector< Simba::DSI::IBulkProcessor * > &in_bulkProcessors)
 Request fetching and processing of the next batch of rows.
void CloseCursor ()
 Closes the DSI's internal result cursor and clears associated memory.
bool GetDataNeeded (simba_uint16 in_column)
 Gets the data needed status of a column as set by SetDataNeeded.
Simba::DSI::ResultType GetResultType ()
 Returns the type of the result.
Simba::DSI::IColumnsGetSelectColumns ()
 Retrieves an IColumns* which can provide access to column metadata for each columns in the result.
virtual bool HasRowCount ()=0
 Determine if the number of rows is known.
virtual bool IsBulkFetchSupported (std::set< simba_uint32 > &in_boundColumnIndex)
 Determine if the DSII can support bulk fetching for the current query and the given list of bound columns.
virtual Simba::DSI::ICellmarkMarkCell (simba_uint16 in_column)
 Returns a cellmark to the column of the row at which the cursor is positioned.
bool Move (Simba::DSI::DSIDirection in_direction, simba_signed_native in_offset)
 Traverses the result set.
bool RetrieveData (simba_uint16 in_column, SqlData *in_data, simba_signed_native in_offset, simba_signed_native in_maxSize)
 Fills in in_data with a chunk of data for the given column in the current row.
void SetCursorType (Simba::DSI::DSICursorType in_cursorType)
 Sets the type of cursor to be used for traversing over the result set.
void SetDataNeeded (simba_uint16 in_column, bool in_dataNeeded)
 Indicates whether RetrieveData() might be called on the given column after the next call to Move().
void SetFetchRowsetSize (simba_unsigned_native in_rowsetSize)
 Sets the number of rows that are to be fetched to the client application.
virtual ~DSIRowCountResult ()
 Destructor.

Protected Member Functions

 DSIRowCountResult ()
 Constructor.

Detailed Description

An implementation of IResult which represents row count results.


Constructor & Destructor Documentation

virtual ~DSIRowCountResult (  )  [virtual]

Destructor.

DSIRowCountResult (  )  [protected]

Constructor.


Member Function Documentation

virtual simba_unsigned_native BulkFetch ( simba_unsigned_native  in_rowsetSize,
const std::vector< Simba::DSI::IBulkProcessor * > &  in_bulkProcessors 
) [virtual]

Request fetching and processing of the next batch of rows.

The DSII needs to fetch and process at least one row per call unless the end of the rowset is reached. The returned value indicates the actual number of rows that were fetched and processed. The SDK interprets a return value of 0 as if the end of the result set was reached and no more rows are available.

The SDK provides one bulk processor per column that needs to be processed. The index of the column is NOT equal to the index of the bulk processor in the given array, but is accessible through the bulk processor interface. The context necessary for bulk processing needs to be accessible from the class that implements the bulk processor interface.

Parameters:
in_rowsetSize Number of rows to fetch and process.
in_bulkProcessors Vector of pointers to bulk processors. (NOT OWN)
Returns:
Number of rows fetched and converted. 0 indicates no more rows are available.

Implements IResult.

void CloseCursor (  )  [virtual]

Closes the DSI's internal result cursor and clears associated memory.

Exceptions:
DSIException always since there are no cursors for row count results.

Implements IResult.

bool GetDataNeeded ( simba_uint16  in_column  )  [virtual]

Gets the data needed status of a column as set by SetDataNeeded.

If SetDataNeeded was not called, the value is assumed to be false.

Parameters:
in_column A column index. The first column uses index 0.
Exceptions:
DSIException since there are no data columns associated with a row count result.
Returns:
The data needed status of in_column.

Implements IResult.

Simba::DSI::ResultType GetResultType (  )  [virtual]

Returns the type of the result.

For this class, ROW_COUNT is always returned.

Returns:
Result type -- ROW_COUNT

Implements IResult.

Simba::DSI::IColumns* GetSelectColumns (  )  [virtual]

Retrieves an IColumns* which can provide access to column metadata for each columns in the result.

NULL is returned since row count results do not generate any column metadata.

Returns:
IColumns reference that provides access to column metadata.

Implements IResult.

virtual bool HasRowCount (  )  [pure virtual]

Determine if the number of rows is known.

Returns:
True if the number of rows is known; false otherwise.

Implements IResult.

Implemented in DSISimpleRowCountResult.

virtual bool IsBulkFetchSupported ( std::set< simba_uint32 > &  in_boundColumnIndexes  )  [virtual]

Determine if the DSII can support bulk fetching for the current query and the given list of bound columns.

Parameters:
in_boundColumnIndexes Set containing the indexes of all bound columns (meaning the column values are 0-based).
Returns:
true if the DSII supports bulk fetch; false otherwise.

Implements IResult.

virtual Simba::DSI::ICellmark* MarkCell ( simba_uint16  in_column  )  [virtual]

Returns a cellmark to the column of the row at which the cursor is positioned.

Marking a cell tells the DSII that the column being marked will require data, but not at this point, at a later time (likely after the cursor has moved past this column and/or past this row and/or past this result set). For DSI implementations that only support forward-only cursors, the DSII might cache this data for later access. For DSI implementations that support bidirectional cursors, the DSII might cache details of the result set, result set's row and result set row's column so it can reposition the cursor and retrieve the data. DSI implementations that do not support cellmarking would return a NULL pointer and/or throw an Exception. This data may/may not persist after a cursor has been closed.

Parameters:
in_column A column index for this cellmark. The first column uses index 0.
Returns:
Returns a cellmark to mark the column of the row. (OWN)

Implements IResult.

bool Move ( Simba::DSI::DSIDirection  in_direction,
simba_signed_native  in_offset 
) [virtual]

Traverses the result set.

Different CursorTypes correspond to support for different sets of values of in_direction. If an unsupported Direction is provided, an exception may be thrown.

Parameters:
in_direction Direction to traverse the result set
in_offset Used for certain directions to indicate an offset from a relative position.
Exceptions:
DSIException always since there are no cursors for row count results.
Returns:
True if the move succeeds; false if there are no more rows left.

Implements IResult.

bool RetrieveData ( simba_uint16  in_column,
SqlData in_data,
simba_signed_native  in_offset,
simba_signed_native  in_maxSize 
) [virtual]

Fills in in_data with a chunk of data for the given column in the current row.

The SqlTypeMetadata* used by in_data is the same SqlTypeMetadata* exposed by the IColumn describing the column.

Parameters:
in_column A column index. The first column uses index 0.
in_data Holds a buffer to store the requested data.
in_offset Number of bytes in the data to skip before copying into in_data.
in_maxSize Maximum number of bytes of data to returning in in_data.
Exceptions:
DSIException since there are no data columns associated with a row count result.
Returns:
True if there is more data; false otherwise.

Implements IResult.

void SetCursorType ( Simba::DSI::DSICursorType  in_cursorType  )  [virtual]

Sets the type of cursor to be used for traversing over the result set.

This method must be called before calling Move(). Otherwise the cursor type used is undefined. If the given cursor type is not supported, an exception may be thrown.

Parameters:
in_cursorType Type of cursor used by the DSI to traverse the result set.
Exceptions:
DSIException always since there are no cursors for row count results.

Implements IResult.

void SetDataNeeded ( simba_uint16  in_column,
bool  in_dataNeeded 
) [virtual]

Indicates whether RetrieveData() might be called on the given column after the next call to Move().

The value given here applies for any subsequent Move() calls.

Parameters:
in_column A column index. The first column uses index 0.
in_dataNeeded Indicates whether data may be retrieved from the given column by the ODBC layer or not.
Exceptions:
DSIException since there are no data columns associated with a row count result.

Implements IResult.

void SetFetchRowsetSize ( simba_unsigned_native  in_rowsetSize  )  [virtual]

Sets the number of rows that are to be fetched to the client application.

This value is to be used as an optimization hint by the DSII to possibly implement pre-fetching of data. It should not affect the number of rows the Move() function moves by.

Eg. If SetFetchRowsetSize(10) is called. The next call to Move() may choose to use this information to fetch and cache 10 or more rows of data. The following 9 calls to Move() do not necessarily need to fetch more data and can just use cached data.

This method should be called before calling Move() and may be called again if the application changes this value. If it is not called, the default rowset size should be assumed to be 1.

The default implementation in DSIRowCountResult throws an exception.

Parameters:
in_rowsetSize The number of rows the application is requesting per fetch.
Exceptions:
DSIException always since there are no rowsets for row count results.

Implements IResult.


The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:15 2017 for SimbaEngine 10.1.3.1011 by simba