Small. Fast. Reliable.
Choose any three.

SQLite C Interface

Open A BLOB For Incremental I/O

int sqlite3_blob_open(
  sqlite3*,
  const char *zDb,
  const char *zTable,
  const char *zColumn,
  sqlite3_int64 iRow,
  int flags,
  sqlite3_blob **ppBlob
);

This interfaces opens a handle to the blob located in row iRow, column zColumn, table zTable in database zDb; in other words, the same blob that would be selected by:

SELECT zColumn FROM zDb.zTable WHERE rowid = iRow;

If the flags parameter is non-zero, the blob is opened for read and write access. If it is zero, the blob is opened for read access.

Note that the database name is not the filename that contains the database but rather the symbolic name of the database that is assigned when the database is connected using ATTACH. For the main database file, the database name is "main". For TEMP tables, the database name is "temp".

On success, SQLITE_OK is returned and the new blob handle is written to *ppBlob. Otherwise an error code is returned and any value written to *ppBlob should not be used by the caller. This function sets the database-handle error code and message accessible via sqlite3_errcode() and sqlite3_errmsg().

Invariants:

F17813 A successful invocation of the sqlite3_blob_open(D,B,T,C,R,F,P) interface opens an sqlite3_blob object P on the blob in column C of table T in database B on database connection D.
F17814 A successful invocation of sqlite3_blob_open(D,...) starts a new transaction on database connection D if that connection is not already in a transaction.
F17816 The sqlite3_blob_open(D,B,T,C,R,F,P) interface opens the blob for read and write access if and only if the F parameter is non-zero.
F17819 The sqlite3_blob_open() interface returns SQLITE_OK on success and an appropriate error code on failure.
F17821 If an error occurs during evaluation of sqlite3_blob_open(D,...) then subsequent calls to sqlite3_errcode(D), sqlite3_errmsg(D), and sqlite3_errmsg16(D) will return information approprate for that error.

See also lists of Objects, Constants, and Functions.


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