Small. Fast. Reliable.
Choose any three.

About Sitemap Documentation Download License News Developers Support

## SQLite C Interface

## Read Data From A BLOB Incrementally

>     int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);

This function is used to read data from an open BLOB handle into a caller-supplied buffer. N bytes of data are copied into buffer Z from the open BLOB, starting at offset iOffset.

If offset iOffset is less than N bytes from the end of the BLOB, SQLITE_ERROR is returned and no data is read. If N or iOffset is less than zero, SQLITE_ERROR is returned and no data is read.

An attempt to read from an expired BLOB handle fails with an error code of SQLITE_ABORT.

On success, SQLITE_OK is returned. Otherwise, an error code or an extended error code is returned.

### Invariants:

H17853 | A successful invocation of sqlite3_blob_read(P,Z,N,X) shall reads N bytes of data out of the BLOB referenced by BLOB handle P beginning at offset X and store those bytes into buffer Z.
H17856 | In sqlite3_blob_read(P,Z,N,X) if the size of the BLOB is less than N+X bytes, then the function shall leave the Z buffer unchanged and return SQLITE_ERROR.
H17859 | In sqlite3_blob_read(P,Z,N,X) if X or N is less than zero then the function shall leave the Z buffer unchanged and return SQLITE_ERROR.
H17862 | The sqlite3_blob_read(P,Z,N,X) interface shall return SQLITE_OK if N bytes are successfully read into buffer Z.
H17863 | If the BLOB handle P is expired and X and N are within bounds then sqlite3_blob_read(P,Z,N,X) shall leave the Z buffer unchanged and return SQLITE_ABORT.
H17865 | If the requested read could not be completed, the sqlite3_blob_read(P,Z,N,X) interface shall return an appropriate error code or extended error code.
H17868 | If an error occurs during evaluation of sqlite3_blob_read(P,...) then subsequent calls to sqlite3_errcode(D), sqlite3_extended_errcode(), sqlite3_errmsg(D), and sqlite3_errmsg16(D) shall return information appropriate for that error, where D is the database connection that was used to open the BLOB handle P.

See also lists of Objects, Constants, and Functions.

This page last modified 2008/12/09 18:44:04 UTC