![]() | ![]() |
Home |
|
|
Open Client Client-Library/C Reference Manual |
|
| Chapter 3 Routines |
|
| ct_fetch |
|
| Return values |
ct_fetch returns the following values:
Return value | Meaning |
CS_SUCCEED | The routine completed successfully. ct_fetch places the number of rows read in *rows_read. The application must continue to call ct_fetch, as the result data is not yet completely fetched. |
CS_END_DATA | All rows of the current result set have been fetched. The application should call ct_results to get the next result set. |
CS_ROW_FAIL | A recoverable error occurred while fetching a row. The application must continue calling ct_fetch to keep retrieving rows, or can call ct_cancel to cancel the remaining results. When using array binding, CS_ROW_FAIL indicates a partial result is available in the bound arrays. ct_fetch sets *row_count to indicate the number of rows transferred (including the row containing the error) and transfers no rows after that row. The next call to ct_fetch will read rows starting with the row after the one where the error occurred. Recoverable errors include memory allocation failures and conversion errors (such as overflowing the destination buffer) that occur while copying row values to program variables. In the case of buffer-overflow errors, ct_fetch sets the corresponding *indicator variable(s) to a value greater than 0. Indicator variables must have been specified in the application's calls to ct_bind. |
CS_FAIL | The routine failed. ct_fetch places the number of rows fetched in *rows_read. This number includes the failed row. Unless the routine failed due to application error (for example, bad parameters), additional result rows are not available. If ct_fetch returns CS_FAIL, an application must call ct_cancel with type as CS_CANCEL_ALL before using the affected command structure to send another command. If ct_cancel returns CS_FAIL, the application must call ct_close(CS_FORCE_CLOSE) to force the connection closed. |
CS_CANCELED | The current result set and any additional result sets have been canceled. Data is no longer available. ct_fetch places the number of rows fetched before the cancel occurred in *rows_read. |
CS_PENDING | Asynchronous network I/O is in effect. See "Asynchronous programming". |
CS_BUSY | An asynchronous operation is already pending for this connection. See "Asynchronous programming". |
A common reason for a ct_fetch failure is that a program variable specified via ct_bind is not large enough for a fetched data item.
|
|