When a preplanned SQL statement becomes invalid, it shows the SQLITE_SCHEMA error for such statement. You should recompile the SQL using sqlite3_prepare().