Name

sqlite3_blob_read() — Read data from a BLOB

Definition

int sqlite3_blob_read( sqlite3_blob* blob, void* buff, int bytes, int offset );
blob

A BLOB handle acquired from sqlite3_blob_open().

buff

A data buffer. Data is read from the BLOB into the buffer.

bytes

The number of bytes to read from the BLOB into the buffer.

offset

Offset from beginning of BLOB where read should start.

Returns

An SQLite return code. Attempting to read from an expired BLOB handle will return SQLITE_ABORT.

Description

This function reads the specified number of bytes from a BLOB value into the given buffer. The read will start from the provided offset. Any attempt to read past the end of the BLOB results in an error, meaning that the BLOB must have bytes + offset or more bytes.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.