Re: [sqlite] sqlite3_step to select and update the same table

2010-11-09 Thread Stephen Chrzanowski
Well, with your 5 gig table, the select statement needs to still compile a set of results somehow, be it data or pointers to the data, and remember which row has been read. As I said, I've never looked or traced the code, but something has be be created somewhere that says "This is the next record

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-08 Thread Woody & Yuni Ho
ep to select and update the same table SQL will not do the trick for me because I based on the select I have to perform other operations(queries on other tables) and only then can I update the table in question. Kees Nuyt wrote: > > There is no need to do this in a loop with a cursor. > Whe

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-08 Thread cricketfan
SQL will not do the trick for me because I based on the select I have to perform other operations(queries on other tables) and only then can I update the table in question. Kees Nuyt wrote: > > There is no need to do this in a loop with a cursor. > Whenever possible, use the power of SQL set ope

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-08 Thread Simon Slavin
On 8 Nov 2010, at 9:27pm, Stephen Chrzanowski wrote: > I don't know how the code works, but logically speaking, if I'm at row B, > and I update row B to E, row B physically remains B but has its data content > changed to E. From there on in, it should go on to C then D then F, etc. And naturall

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-08 Thread Kees Nuyt
On Sun, 7 Nov 2010 10:14:29 -0800 (PST), cricketfan wrote: >Just to make things clearer >the value being fetched into ref from the database, is also the value being >changed(ghi) in the update statement. When I change my query (just to debug) >to update some other column in the table the whole th

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-08 Thread Stephen Chrzanowski
I don't know how the code works, but logically speaking, if I'm at row B, and I update row B to E, row B physically remains B but has its data content changed to E. From there on in, it should go on to C then D then F, etc. Since the full rowset results already exist somewhere, it shouldn't show

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread Simon Slavin
On 8 Nov 2010, at 2:02am, cricketfan wrote: > Simon, As per my understanding I am getting the result set and trying to > change values in the table based on what I read from the result set up to > that point. I see no reason why I should be stopped from updating the row I > have already read in t

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread cricketfan
Simon, As per my understanding I am getting the result set and trying to change values in the table based on what I read from the result set up to that point. I see no reason why I should be stopped from updating the row I have already read in the result set. Simon Slavin-3 wrote: > > > On 7 N

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread Simon Slavin
On 7 Nov 2010, at 6:14pm, cricketfan wrote: > Just to make things clearer > the value being fetched into ref from the database, is also the value being > changed(ghi) in the update statement. When I change my query (just to debug) > to update some other column in the table the whole thing runs fi

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread cricketfan
Just to make things clearer the value being fetched into ref from the database, is also the value being changed(ghi) in the update statement. When I change my query (just to debug) to update some other column in the table the whole thing runs fine and runs only once! Can someone throw some light o

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread Kees Nuyt
On Sat, 6 Nov 2010 21:29:58 -0700 (PDT), cricketfan wrote: >I am trying to select some columns from a table and use that to >update another column in the same table using prepare/step/reset/finalize >methods. However, when I use the update statement while stepping it is >executing the flo

Re: [sqlite] sqlite3_step to select and update the same table

2010-11-07 Thread Simon Slavin
On 7 Nov 2010, at 4:29am, cricketfan wrote: >I am trying to select some columns from a table and use that to > update another column in the same table using prepare/step/reset/finalize > methods. However, when I use the update statement while stepping it is > executing the flow 2 times.

[sqlite] sqlite3_step to select and update the same table

2010-11-06 Thread cricketfan
Hello, I am trying to select some columns from a table and use that to update another column in the same table using prepare/step/reset/finalize methods. However, when I use the update statement while stepping it is executing the flow 2 times. In order to clarify, I am pasting some pseudo