Name
sqlite3_next_stmt() — Step through a list of prepared statements
Definition
sqlite3_stmt* sqlite3_next_stmt( sqlite3* db, sqlite3_stmt* stmt );
-
db A database connection.
-
stmt The previous statement. To get the first statement, pass in a NULL.
- Returns
A prepared statement pointer. A NULL indicates the end of the list.
Description
This function iterates over the list of prepared statements associated with the given database connection. Passing in a NULL statement pointer will return the first statement. Subsequent statements can be retrieved by passing back the last returned statement value.
If an application is iterating over prepared statements and
finalizing them, remember that the sqlite3_finalize() function will remove the
statement from the statement list. In such cases, the
application should keep passing in a NULL statement value until
no more statements remain. This technique is not recommended,
however, as it can leave dangling statement pointers.
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