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

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

2010-11-07 Thread cricketfan
I thought call to clear bindings and reset was working but I got confused and am wherever I was before posting on the forum. Still have no conclusive evidence as to why the database in my application is behaving in a weird fashion. Any further input would be appreciated. cricketfan wrote: > >

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

[sqlite] Idea for one of the testing suites

2010-11-07 Thread Simon Slavin
Several bugs I've been reading about here seem to be cases where the query optimizer works differently between one version of SQLite and the next. So I wondered whether it would be possible for the testing suite to log the amount of time taken for each operation, leading to a long series of

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

2010-11-07 Thread cricketfan
Mike I also was not able to reproduce this behavior with a small sample program and am puzzled by this behavior in my main application. What puzzled me is 1. Select has criteria a=?, b=?, c=? (prepare statement) - step through it 2. Get the value of d from database based on the above criteria 3.

[sqlite] Query planner bug on "distinct" clause

2010-11-07 Thread Alexey Pechnikov
sqlite> .s object_record CREATE TABLE object_record ( record_id INTEGER PRIMARY KEY, ts INTEGER NOT NULL DEFAULT (strftime('%s','now')), object_id INTEGER NOT NULL ); CREATE INDEX object_id_ts_idx on object_record(object_id,ts); CREATE INDEX object_ts_idx on object_record(ts); The planner

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

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

[sqlite] Compiling SQLite on Solaris 64bit and SPARC?

2010-11-07 Thread Lynton Grice
Hi there, I have just downloaded the latest version of SQLite (sqlite-amalgamation-3.7.3.tar.gz) and am trying to compile it on my Solaris 10 64bit machine, but get an error for some reason (see below). I ran a "./configure" (with no parameters) and it seemed to be fine, but then the

Re: [sqlite] INSERT OR IGNORE with rtree virtual tables

2010-11-07 Thread Peter Kolbus
Any thoughts on this? Thanks, Peter Kolbus On Sat, Oct 30, 2010 at 8:27 PM, Peter Kolbus wrote: > Hi, > > It seems that the OR IGNORE clause is not working with an RTREE > virtual table.  The documentation (http://sqlite.org/rtree.html, > section 3.2) implies that this

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

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.

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

2010-11-07 Thread Black, Michael (IS)
I think the quick answer is to use a different database handle for your update. I think you may also be able to do this with WAL mode. http://www.sqlite.org/draft/wal.html I did some searching and couldn't find a definitive answer for doing an update inside a select loop (though I'm sure I've

Re: [sqlite] Question about manifest typing/data affinity

2010-11-07 Thread Tito Ciuro
Hello everyone, Sorry about my last email... I clicked Send too quickly. Jay, the book is great, I have discovered quite a few details I had overlooked (or perhaps missed, since I worked with earlier versions of SQLite and some current features were not available yet). Thank you and all who

Re: [sqlite] Question about manifest typing/data affinity

2010-11-07 Thread Tito Ciuro
On 06/11/2010, at 21:28, Jay A. Kreibich wrote: > On Sat, Nov 06, 2010 at 08:35:10PM -0300, Tito Ciuro scratched on the wall: >> Hello, >> >> I have a question about manifest typing/data affinity. Assume I have >> created this table: >> >> CREATE TABLE foo (ROWID INTEGER PRIMARY KEY, key

Re: [sqlite] sqlite.exe db_name .dump : It missed : table name is un quoted.(INSERT statement)

2010-11-07 Thread ぽぽんGM
sqlite-2.8.17-47fee16ba9bd8ab2.diff --- SQLite-47fee16ba9bd8ab2/src/shell.c +++ SQLite-47fee16ba9bd8ab2/src/shell.c @@ -421,7 +421,7 @@ p->zDestTable = 0; } if( zName==0 ) return; - needQuote = !isalpha(*zName) && *zName!='_'; + needQuote = *zName!='_'; for(i=n=0; zName[i]; i++, n++){ if(