const void* sqlite3_column_blob( sqlite3_stmt* stmt, int cidx ); double sqlite3_column_double( sqlite3_stmt* stmt, int cidx ); int sqlite3_column_int( sqlite3_stmt* stmt, int cidx ); sqlite3_int64 sqlite3_column_int64( sqlite3_stmt* stmt, int cidx ); const unsigned char* sqlite3_column_text( sqlite3_stmt* stmt, int cidx ); const void* sqlite3_column_text16( sqlite3_stmt* stmt, int cidx ); sqlite3_value* sqlite3_column_value( sqlite3_stmt* stmt, int cidx );
stmt
A prepared and executed statement.
cidx
A column index. The first column has an index
of zero (0
).
The requested value.
These functions extract values from a prepared statement. Values
are available any time sqlite3_step()
returns SQLITE_ROW
. If the requested type is different
than the actual underlying value, the value will be converted
using the conversion rules defined by Table 7-1.
SQLite will take care of all memory management for the buffers
returned by these functions. Pointers returned may become
invalid at the next call to sqlite3_step()
, sqlite3_reset()
, sqlite3_finalize()
, or any sqlite3_column_xxx()
call on the
same column index. Pointers can also become invalid because of a
call to one of the sqlite3_column_bytes()
functions.
Be warned that sqlite3_column_int()
will clip any integer
values to 32 bits. If the database contains values that cannot
be represented by a 32-bit signed integer, it is safer to use
sqlite3_column_int64()
.
The buffer returned by sqlite3_column_text()
and sqlite3_column_text16()
will
always be null-terminated.
The structure returned by sqlite3_column_value()
is an unprotected
sqlite3_value
object.
This object can only be used
in conjunction with sqlite3_bind_value()
or sqlite3_
result_
value()
. Calling any of the
sqlite3_value_xxx()
functions will result in undefined behavior.
sqlite3_column_count() [C API, Ap G], sqlite3_column_bytes() [C API, Ap G], sqlite3_column_type() [C API, Ap G], sqlite3_value_xxx() [C API, Ap G]