SQLite Forum

Nesting of statements
Login
> Interleaving the row fetching from a SELECT with concomitant UPDATE involving common tables in both is fraught with peril. 
>
> The proper solution is to not do that.

It would be nice if the sqlite manual said this somewhere, and if it could reliably detect and report API misuse in such cases (when SQLITE_ENABLE_API_ARMOR is set).