Name

sqlite3_blob_write() — Write data to a BLOB

Definition

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

A BLOB handle acquired from sqlite3_blob_open().

buff

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

bytes

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

offset

Offset from beginning of BLOB where write should start.

Returns

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

Description

This function writes the specified number of bytes from the given buffer into a BLOB value. The write starts at the provided offset. Any attempt to write 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.