"Igor Tandetnik" <[EMAIL PROTECTED]> writes:
> "Nikolaus Rath" <[EMAIL PROTECTED]> wrote in
> message news:[EMAIL PROTECTED]
>> What happens if
>>
>> 1. I prepare and execute a select statement
>> 2. I retrieve a couple of rows
>> 3. I execute a new query that would change the result of the
>> query in 1
>
> On the same connection, I assume.
Yes.
>> 4. I continue to retrieve the results of 1)
>>
>> Will I get the results as if step 3 hasn't happened, is the result
>> undefined, or will my result set somehow be updated?
>
> You may or may not see the changes introduced by step 3. E.g. if
> step 3 updates a record that you've already visited, you naturally
> won't visit it again and thus won't see the changes. But if it
> updates a record you haven't visited yet, when you get to it you
> will see the new data.
This doesn't seem right when I test it. "numbers" is a table with one
column containing the numbers 1 to 10. When using the python
interface:
>>> import apsw
>>> conn=apsw.Connection("data")
>>> cursor = conn.cursor()
>>> res = cursor.execute("select * from numbers")
>>> res.next()
(1,)
>>> res.next()
(2,)
>>> res.next()
(3,)
>>> cursor.execute("delete from numbers where no=5")
>>> res.next()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
StopIteration
So as soon as I make a change in the database, I do not get any more
results. If I understood you correctly, I should have gotten (4,)
instead.
Is this a bug?
Best,
-Nikolaus
--
»It is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that.«
-J.H. Hardy
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users