Description

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.

See Also

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]