Name
sqlite3_data_count() — Get the number of valid result columns in a statement
Definition
int sqlite3_data_count( sqlite3_stmt* stmt );
-
stmt A prepared statement.
- Returns
The number of columns available in a prepared statement.
Description
This function returns the number of columns available in a row
result. Column indexes start at zero (0), so if this function returns 5, value column
indexes are 0 to 4. The value zero (0) will be returned if there is no current
result row.
This function is almost identical to sqlite3_column_count(). The main difference is
that this function will return zero (0) if no valid result row is currently
available (for example, before sqlite3_step() is called), while sqlite3_column_count() will
always return the number of expected columns, even if no row is
currently available.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access