IdmaResultSet

The IdmaResultSet interface provides the methods specific to a result set object, such as asking when search results are available, retrieving those results, terminating and restarting a search.

IdmaResultSet::GetNextResultRow

This method must be supported in every implementation of this interface.

Syntax
DmaRC IdmaResultSet::GetNextResultRow (
DMA_REFIID riid,
pDmapv ppIResultRow)

Parameters

Name

Mode

Description

riid

input

The Id of the desired interface on the result row object.

ppIResultRow

ouput

Location in which to return an interface to the result row object

Description

This method returns the next query result row (dmaClass_QueryResultRow), if any.

Return Values

Name

Description

DMARC_BAD_PARAMETER

(E_INVALIDARG) Invalid input parameter.

DMARC_MAX_ROWS

A result set was truncated because it exceeded the maximum result items parameter.

DMARC_NO_MEMORY

(E_OUTOFMEMORY) Insufficient memory to complete the operation.

DMARC_OK

(S_OK) Success.

DMARC_QUERY_AT_END

The query ran to successful completion without encountering any constraints on time limits, number of rows generated, or any other constraints, and there are no more result rows that satisfy the query. A result row is not returned. No more result rows will be returned unless ReExecuteQuery is executed.

DMARC_RESULTS_TRUNCATED

The result set was truncated explicitly by a call on IdmaResultSet:: TerminateResults. No further rows will be returned unless ReExecuteQuery is executed. This is a failure code - no row is returned.

DMARC_TIMEOUT

A time limit has been exceeded.

IdmaResultSet::IsResultReady

Support for this method is optional.

Syntax
DmaRC IdmaResultSet::IsResultReady (
pDmaBoolean pbIsReady)

Parameters

Name

Mode

Description

pbIsReady

output

Returns DMA_TRUE if the search results are ready to be delivered.

Description

Poll to see if the results are ready to be delivered. When the IdmaScope::ExecuteSearch method returns, the search operation may not be complete (e.g., the result set may not be ready to deliver its results). The pbIsReady parameter will be set to the value DMA_FALSE if the results are not ready, and will be set to DMA_TRUE if at least one result set item is ready to be delivered.

In more detail, DMA_TRUE is returned if at least one result set item can be returned by GetNextResultRow without blocking, or if all the rows satisfying the search criteria have been returned, or because the result set has been truncated (see the MaximumResultItems property of the query object) and the last available row has already been returned by GetNextResultRow.

This method will not return FALSE indefinitely if there are any results rows that can be generated.

Note that support of this method is optional. A document space may choose to implement synchronous searches (ExecuteSearch does not return until all results are ready). If this method is supported, a document space may choose to generate result items as a side effect of calls upon it.

Return Values

Name

Description

DMARC_BAD_PARAMETER

(E_INVALIDARG) Invalid input parameter.

DMARC_NOT_SUPPORTED

This method is not supported in the context of this session or object.

DMARC_OK

(S_OK) Success.

DMARC_RESULTS_TRUNCATED

The result set was truncated explicitly by a call on IdmaResultSet:: TerminateResults. No further rows will be returned unless ReExecuteQuery is executed. This is a failure code - no row is returned.

IdmaResultSet::ReExecuteQuery

This method must be supported in every implementation of this interface.

Syntax
DmaRC IdmaResultSet::ReExecuteQuery (
Dmapv pICallback)

Parameters

Name

Mode

Description

pICallback

input

Pointer to a callback interface whose ReportProgress method will optionally be called at regular intervals during this function call. This pointer may be NULL.

Description

This method performs processing necessary for reexecution of the query against the persistent store, so that GetNextResultRow can be called to generate a fresh sequence of query result rows.

Return Values

Name

Description

DMARC_ABORT

The progress callback indicated that the method should be aborted.

DMARC_NO_MEMORY

(E_OUTOFMEMORY) Insufficient memory to complete the operation.

DMARC_OK

(S_OK) Success.

IdmaResultSet::TerminateResults

This method must be supported in every implementation of this interface.

Syntax
DmaRC IdmaResultSet::TerminateResults ( )

Description

Terminate delivery of result rows for this result set.

After a successful call to TerminateResults, any of the non-inherited IdmaResultSet methods return DMARC_RESULTS_TRUNCATED until ReExecuteQuery is called.

Return Values

Name

Description

DMARC_OK

(S_OK) Success.

DMARC_RESULTS_TRUNCATED

The result set was truncated explicitly by a call on IdmaResultSet:: TerminateResults. No further rows will be returned unless ReExecuteQuery is executed. This is a failure code - no row is returned.