Name

sqlite3_bind_xxx() — Bind values to statement parameters

Definition

int sqlite3_bind_blob(     sqlite3_stmt* stmt, int pidx,
                               const void* val, int bytes, mem_callback );
int sqlite3_bind_double(   sqlite3_stmt* stmt, int pidx, double val );
int sqlite3_bind_int(      sqlite3_stmt* stmt, int pidx, int val );
int sqlite3_bind_int64(    sqlite3_stmt* stmt, int pidx, sqlite3_int64 val );
int sqlite3_bind_null(     sqlite3_stmt* stmt, int pidx );
int sqlite3_bind_text(     sqlite3_stmt* stmt, int pidx,
                               const char* val, int bytes, mem_callback );
int sqlite3_bind_text16(   sqlite3_stmt* stmt, int pidx,
                               const void* val, int bytes, mem_callback );
int sqlite3_bind_value(    sqlite3_stmt* stmt, int pidx,
                               const sqlite3_value* val );
int sqlite3_bind_zeroblob( sqlite3_stmt* stmt, int pidx, int bytes );

void mem_callback( void* ptr );
stmt

A prepared statement that contains parameter values.

pidx

The parameter index. The first parameter has an index of one (1).

val

The data value to bind

bytes

The size of the data value, in bytes (not characters). Normally, the length does not include any null terminator. If val is a null-terminated string, and this value is negative, the length will be automatically computed.

mem_callback

An function pointer to a memory deallocation function. This function frees the memory buffer used to hold the value. If the buffer was allocated with sqlite3_malloc(), a reference to sqlite3_free() can be passed directly.

The special flags SQLITE_STATIC and SQLITE_TRANSIENT can also be used. SQLITE_STATIC ...

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.