Small. Fast. Reliable.
Choose any three.

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.

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

Invariants:

F17853 The sqlite3_blob_read(P,Z,N,X) interface reads N bytes beginning at offset X from the blob that sqlite3_blob object P refers to and writes those N bytes into buffer Z.
F17856 In sqlite3_blob_read(P,Z,N,X) if the size of the blob is less than N+X bytes, then the function returns SQLITE_ERROR and nothing is read from the blob.
F17859 In sqlite3_blob_read(P,Z,N,X) if X or N is less than zero then the function returns SQLITE_ERROR and nothing is read from the blob.
F17862 The sqlite3_blob_read(P,Z,N,X) interface returns SQLITE_OK if N bytes where successfully read into buffer Z.
F17865 If the requested read could not be completed, the sqlite3_blob_read(P,Z,N,X) interface returns an appropriate error code or extended error code.
F17868 If an error occurs during evaluation of sqlite3_blob_read(P,...) then subsequent calls to sqlite3_errcode(D), sqlite3_errmsg(D), and sqlite3_errmsg16(D) will return information approprate for that error, where D is the database handle that was used to open blob handle P.

See also lists of Objects, Constants, and Functions.


This page last modified 2008/05/12 13:08:44 UTC