Re: [sqlite] Re: Re: Re: Does sqlite3_step searches for a row in the table / or some results buffer?
Igor Tandetnik wrote: John Stanton <[EMAIL PROTECTED]> wrote: Predictability is ensured by using transactions. By using BEGIN and COMMIT to make transactions atomic you enforce a predictable state. Not if you modify the same data you are iterating over, on the same DB connection and thus within the same transaction. Igor Tandetnik A good point to be aware of when designing for transactional integrity. Read locks are important. - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Re: Re: Re: Does sqlite3_step searches for a row in the table / or some results buffer?
John Stanton <[EMAIL PROTECTED]> wrote: Predictability is ensured by using transactions. By using BEGIN and COMMIT to make transactions atomic you enforce a predictable state. Not if you modify the same data you are iterating over, on the same DB connection and thus within the same transaction. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Re: Re: Re: Does sqlite3_step searches for a row in the table / or some results buffer?
Igor Tandetnik wrote: B V, Phanisekhar <[EMAIL PROTECTED]> wrote: Why it's unpredictable? Why can't the unpredictable be made predictable? Please feel free to submit a patch, if you believe it's that easy. Assume I update the column of a row that meets the criteria of some select stmt and I am yet to encounter that row in sqlite3_step. So the sqlite3_step on that row will return the old column value or new column value for that row? It depends on whether the query reads live data from the table or uses a temporary resultset. E.g. a query with ORDER BY on a table that doesn't have a suitable index has no choice but to retrieve all records In case of complex queries for e.g. ORDER BY (as mentioned by you), I assume I will not be able to see the updated column value. Doesn't u think there is an inconsistency? That's why I said the outcome is unpredictable. Anyway, what are you driving at? What exactly is your suggestion? Also, is there a better function to retrieve all (rows) of the results in one call? Sqlite3_get_table does that, but it uses internally sqlite3_step, which takes lot of time. I, too, would like a database engine that always retrieves all rows in a resultset in the same small amount of time, regardless of how large the resultset is or how many rows must be looked at to calculate it. I also want a pony. However, I realize that I'm highly unlikely to ever get either, and go on with my life. Which I guess is a long way of saying that no, sadly there is no magical way to retrieve all rows in a resultset instantaneously. Igor Tandetnik Igor, as soon as you achieve that goal, let us know. We need someone to bring peace to the Middle East and you would be the best qualified. - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Re: Re: Re: Does sqlite3_step searches for a row in the table / or some results buffer?
B V, Phanisekhar <[EMAIL PROTECTED]> wrote: Why it's unpredictable? Why can't the unpredictable be made predictable? Please feel free to submit a patch, if you believe it's that easy. Assume I update the column of a row that meets the criteria of some select stmt and I am yet to encounter that row in sqlite3_step. So the sqlite3_step on that row will return the old column value or new column value for that row? It depends on whether the query reads live data from the table or uses a temporary resultset. E.g. a query with ORDER BY on a table that doesn't have a suitable index has no choice but to retrieve all records In case of complex queries for e.g. ORDER BY (as mentioned by you), I assume I will not be able to see the updated column value. Doesn't u think there is an inconsistency? That's why I said the outcome is unpredictable. Anyway, what are you driving at? What exactly is your suggestion? Also, is there a better function to retrieve all (rows) of the results in one call? Sqlite3_get_table does that, but it uses internally sqlite3_step, which takes lot of time. I, too, would like a database engine that always retrieves all rows in a resultset in the same small amount of time, regardless of how large the resultset is or how many rows must be looked at to calculate it. I also want a pony. However, I realize that I'm highly unlikely to ever get either, and go on with my life. Which I guess is a long way of saying that no, sadly there is no magical way to retrieve all rows in a resultset instantaneously. Igor Tandetnik - To unsubscribe, send email to [EMAIL PROTECTED] -