> Marcus Grimm <mgr...@medcom-online.de> wrote:
>> what is possible I guess would be to start a transaction
>> inside the loop, do something, and commit and procced
>> with stepping
>
> No, this is not possible either. By starting the select, you also start
> an implicit transaction. SQLite doesn't support nested transactions, so
> you can't start another one in the middle of the loop.

hm... just read again some docs... you are right I guess,
as usual... but reading the docs
(http://www.sqlite.org/lang_transaction.html):
"..The explicit COMMIT command runs immediately, even if there are pending
SELECT statements..."

is still a bit contraire, it sounds like it should be possible
to do what I claimed since I assume only a reading select
statement pending.

anyway, it would be simple to test with a little test code,
I guess I'll do this the next days just to see what happends.
I never did such loops with an explicit transaction inside so far,
only guessing..

>
>> I'm still curious what would be the error code of sqlite3_step
>> if I would delete a row that would be one of the rows
>> reached by the running statement, but that's another issue...;)
>
> There wouldn't be any errors. The row just wouldn't be returned, as if
> it never existed.

I was expecting it to be more complicate because sqlite is running
a sort of machine code while doing the select stepping and for example
if that is using a temporary internal table that looses now an entry in
a source table, for this sqlite would need to re-build a temporary
internal table during each step... or how about a "SELECT ... LIMIT N"
statement that would now need to run one item further than
originally seen by the prepare function?
anyway, I'm afraid I'm about to highjack this thread... ;)

Marcus

>
> Igor Tandetnik
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to