相关文章推荐
叛逆的豌豆  ·  samlists/sam-gh-direct ...·  4 月前    · 
俊逸的肉夹馍  ·  GitHub - ...·  2 年前    · 

Get full access to Using SQLite and 60K+ other titles, with a free 10-day trial of O'Reilly.

There are also live events, courses curated by job role, and more.

Start your free trial

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 );

A prepared statement that contains parameter values.

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

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.

Start your free trial

© 2023, O’Reilly Media, Inc. All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.

We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.

Terms of service Privacy policy Editorial independence

Don’t leave empty-handed

Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.

It’s yours, free.

Get it now

Check it out now on O’Reilly

Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.

Start your free trial Become a member now