With the current design you have to save your query results to memory
then do your
updates from that list.

On 4/20/05, Ben Clewett <[EMAIL PROTECTED]> wrote:
> This is exactly my problem.  My version is 3.1.6.  The error is
> SQLITE_LOCKED.
> 
> Ben
> 
> Jay Sprenkle wrote:
> > I had the same trouble he did. Here's what I did that doesn't work:
> >
> >   select * from a into result;
> >    foreach row in result
> >       ' this fails:
> >       update b set col = a.value;
> >    next
> >
> > But based on what I read here it's supposed to do this.
> >
> > On 4/19/05, Gerry Blanchette <[EMAIL PROTECTED]> wrote:
> >
> >>Could you please elaborate your scenario?
> >>I tried a test myself but am afraid I may not have interpreted your test
> >>case properly.
> >>
> >>I have 2 tables, fred and bob, each with 10000 rows. I select a column
> >>from fred and bind the value obtained from sqlite3_column_int to an
> >>update statement that operates on bob. I loop over fred via
> >>sqlite3_step, where each iteration successfully updates the row in bob.
> >>Both tables exist in the same DB, accessed via the same sqlite3 *.
> >>
> >>Have I misinterpreted your scenario somehow, as this works for me?
> >>
> >>Thank you for helping clear this up for me.
> >>
> >>-- Gerry Blanchette
> >>
> >>-----Original Message-----
> >>From: Ben Clewett [mailto:[EMAIL PROTECTED]
> >>Sent: Monday, April 18, 2005 4:50 AM
> >>To: [email protected]
> >>Subject: [sqlite] Locking Methods
> >>
> >><snip>
> >>I am experiencing problems with the locking.  Because SQLite uses
> >>database locking this forces two major problems:
> >>
> >>- I can't read through a record set and use the data to execute updates.
> >>
> >>  For instance, some parsing exercise which cannot be completed using a
> >>single SQL command.  I have to store all the data locally, get to the
> >>end of the query, then execute and update statements.
> >>
> >>Ben Clewett.
> >></snip>
> >>
> >
> >
> 
> 


-- 
---
You a Gamer? If you're near Kansas City:
Conquest 36
https://events.reddawn.net

The Castles of Dereth Calendar: a tour of the art and architecture of
Asheron's Call
http://www.lulu.com/content/77264

Reply via email to