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 value memory valid. SQLITE_TRANSIENT
will
cause SQLite to make an internal copy of the value
buffer that will be automatically freed when it is
no longer needed.
These functions return a result from an SQL function
implementation. A scalar function and an aggregate finalize
function may return a result. An aggregate step function may
only return an error with sqlite3_result_error_xxx()
. The default return
value will be an SQL NULL unless one of these functions is used.
A function may call one of these functions (and/or calls to
sqlite3_result_error_xxx()
) as many times as
needed to update or reset the result value.
In most other regards, these functions are nearly identical to
the sqlite3_bind_xxx()
functions.