sqldata/sqlctapi.cpp
// Fetch next portion of data to allocate buffers
Fetch next portion of data to allocate buffers
Fetch next portion of data to allocate buffers
int SqlCtApi::Fetch(int *rows_fetched, size_t *time_spent) 
{
	size_t start = GetTickCount();
	int fetched = 0;
	int rc = _ct_fetch(_cursor_cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, (CS_INT*)&fetched);
	if(rc != CS_SUCCEED && rc != CS_END_DATA)
	{
		SetError();
		return -1;
	}
	_cursor_last_fetch_rc = rc;
	if(rows_fetched != NULL)
		*rows_fetched = fetched;
	if(time_spent != NULL)
		*time_spent = GetTickCount() - start;
	return (rc == CS_END_DATA) ? 100 : 0;
}
int SqlCtApi :: Fetch ( int * rows_fetched , size_t * time_spent ) { size_t start = GetTickCount ( ) ; int fetched = 0 ; int rc = _ct_fetch ( _cursor_cmd , CS_UNUSED , CS_UNUSED , CS_UNUSED , ( CS_INT * ) & fetched ) ; if ( rc != CS_SUCCEED && rc != CS_END_DATA ) { SetError ( ) ; return -1 ; } _cursor_last_fetch_rc = rc ; if ( rows_fetched != NULL ) * rows_fetched = fetched ; if ( time_spent != NULL ) * time_spent = GetTickCount ( ) - start ; return ( rc == CS_END_DATA ) ? 100 : 0 ; }
Fetch next portion of data to allocate buffers
Fetch next portion of data to allocate buffers
// Fetch the data // CS_END_DATA is returned if there is no rows in the table, // CS_SUCCEED is still returned if there are less rows than allocated buffer  // Remember last result as we must call ct_fetch until it returns NO DATA