How to prevent sqlite_reset reporting an already known error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to prevent sqlite_reset reporting an already known error

mailing lists
I am executing a prepared statement S with a couple of different bindings. The execution sequence is similar to this

while (moreBindings)
{
 bind_parameters_to_prepared_statement;
sqlite3_step();

if (error)
{

}
sqlite_reset();
if (error)
{
}

}

The issue is that sqlite_reset() reports the same error that already sqlite3_step() reported. How can I prevent that sqlite_reset() reports the same error. I also tried to clear the bindings before the reset statement but this did not help either.

PS: Actually, I am using not directly the SQLite statement but a wrapper around it that makes it a bit more complicated to filter out the multiple reported same error.

Regards,
Hardy

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: How to prevent sqlite_reset reporting an already known error

Simon Slavin-3
On 26 Feb 2020, at 11:58pm, mailing lists <[hidden email]> wrote:

> The issue is that sqlite_reset() reports the same error that already sqlite3_step() reported. How can I prevent that sqlite_reset() reports the same error.

You can't.  It's working as designed.

One would normally test the result that sqlite_reset() returns, making sure it is either SQLITE_OK or the error you got from sqlite3_step(). However I see you're using a wrapper that makes it difficult.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users