sqldata/sqlctapi.cpp
// Close the cursor and deallocate buffers
Close the cursor and deallocate buffers
Close the cursor and deallocate buffers
int SqlCtApi::CloseCursor()
{
	TRACE("Sybase CTLIB CloseCursor() Entered");
	int	rc = _ct_cancel(NULL, _cursor_cmd, CS_CANCEL_ALL);
	rc = _ct_cmd_drop(_cursor_cmd);
	_cursor_cmd = NULL;
	for(int i = 0; i < _cursor_cols_count; i++)
	{
		TRACE("Sybase CTLIB free data");
		delete [] _cursor_cols[i]._data;
		TRACE("Sybase CTLIB free indicators");
		delete [] _cursor_cols[i]._ind2;
		TRACE("Sybase CTLIB free length indicators");
		delete [] _cursor_cols[i]._len_ind4;
	}
	TRACE("Sybase CTLIB free columns");
	delete [] _cursor_cols;
	_cursor_cols = NULL;
	_cursor_cols_count = 0;
	_cursor_allocated_rows = 0;
	TRACE("Sybase CTLIB CloseCursor() Left");
	return 0;
}
int SqlCtApi :: CloseCursor ( ) { TRACE ( " " ) ; int rc = _ct_cancel ( NULL , _cursor_cmd , CS_CANCEL_ALL ) ; rc = _ct_cmd_drop ( _cursor_cmd ) ; _cursor_cmd = NULL ; for ( int i = 0 ; i < _cursor_cols_count ; i ++ ) { TRACE ( " " ) ; delete [ ] _cursor_cols [ i ] . _data ; TRACE ( " " ) ; delete [ ] _cursor_cols [ i ] . _ind2 ; TRACE ( " " ) ; delete [ ] _cursor_cols [ i ] . _len_ind4 ; } TRACE ( " " ) ; delete [ ] _cursor_cols ; _cursor_cols = NULL ; _cursor_cols_count = 0 ; _cursor_allocated_rows = 0 ; TRACE ( " " ) ; return 0 ; }
Close the cursor and deallocate buffers
Close the cursor and deallocate buffers
// Close cursor can be called when not all rows are fetched (error creating table in the target database i.e.), so we need to cancel command // Delete allocated buffers