On 07/24/2018 09:05 PM, Peter Da Silva wrote:
> In the documentation for sqlite3_prepare_v2, it says:
> *ppStmt is left pointing to a compiled prepared statement<https://www.sqlite.org/c3ref/stmt.html> that can be executed using sqlite3_step()<https://www.sqlite.org/c3ref/step.html>. If there is an error, *ppStmt is set to NULL. If the input text contains no SQL (if the input is an empty string or a comment) then *ppStmt is set to NULL. The calling procedure is responsible for deleting the compiled SQL statement using sqlite3_finalize()<https://www.sqlite.org/c3ref/finalize.html> after it has finished with it. ppStmt may not be NULL.
> Is an empty SQL statement always an error, i.e. is it possible for sqlite3_prepare_v2 to return SQLITE_OK while leaving *ppStmt NULL?
No. An empty SQL statement is not an error. prepare_v2() should return
SQLITE_OK and sets *ppStmt to NULL.