isc_close_blob()
Go Up to API Function Reference
Closes an open Blob, which involves flushing any remaining segments, releasing system resources associated with Blob update or retrieval, and setting the Blob handle to zero.
Syntax
ISC_STATUS isc_close_blob(
ISC_STATUS *status_vector,
isc_blob_handle *blob_handle);
Parameter | Type | Description |
---|---|---|
|
|
Pointer to the error status vector |
|
|
Pointer to the handle of the Blob to close |
Description
isc_close_blob()
is used to store a Blob in the database and clean up after Blob operations. Close any Blob after reading from or writing to it. If, for some reason, your application does not close a Blob, you can lose data. If your application might open a Blob without closing it then you should call isc_cancel_blob
() to make sure that the application does not try to open a Blob that is already open.
blob_handle
is set by a call to isc_create_blob2()
or to isc_open_blob2
().
Example
The following example closes a Blob and frees system resources:
if (status_vector[1] == isc_segstr_eof) isc_close_blob(status_vector, &blob_handle)
Return value
isc_close_blob()
returns the second element of the status vector. Zero indicates success. A nonzero value indicates an error. For InterBase errors, the first element of the status vector is set to 1, and the second element is set to an InterBase error code.
To check for an InterBase error, examine the first two elements of the status vector directly. For more information about examining the status vector, see Handling Error Conditions.