Name

sqlite3_result_xxx() — Return an result from an SQL function

Definition

void sqlite3_result_blob(     sqlite3_context* ctx, const void* val, 
                                                    int bytes, mem_callback )
void sqlite3_result_double(   sqlite3_context* ctx, double val );
void sqlite3_result_int(      sqlite3_context* ctx, int val );
void sqlite3_result_int64(    sqlite3_context* ctx, sqlite3_int64 val );
void sqlite3_result_null(     sqlite3_context* ctx );
void sqlite3_result_text(     sqlite3_context* ctx, const char* val,
                                                    int bytes, mem_callback )
void sqlite3_result_text16(   sqlite3_context* ctx, const void* val,
                                                    int bytes, mem_callback )
void sqlite3_result_text16le( sqlite3_context* ctx, const void* val,
                                                    int bytes, mem_callback )
void sqlite3_result_text16be( sqlite3_context* ctx, const void* val,
                                                    int bytes, mem_callback )
void sqlite3_result_value(    sqlite3_context* ctx, sqlite3_value* val );
void sqlite3_result_zeroblob( sqlite3_context* ctx, int bytes );

void mem_callback( void* ptr );
ctx

An SQL function context, provided by the SQLite library.

val

Data value to return.

bytes

The size of the data value, in bytes. In specific, text values are in bytes, not characters.

mem_callback

A function pointer to a memory deallocation function. This function is used to free 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 indicates that the application will keep ...

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.