On Thu, Apr 05, 2012 at 03:15:37PM +0100, Simon Slavin scratched on the wall:
> On 5 Apr 2012, at 3:04pm, Andreas Wiencke <wien...@flyingdog.de> wrote:

> > In my code I want to read from one table and write the results to
> > another table. But if I don't fetch all the results and close the
> > reading connection, I cannot write to another table in the same database.
> 
> As a rule, even though SQLite allows you to do a SELECT in many steps
> bit by bit, you shouldn't mess with the contents of the database in
> the middle of a SELECT.  I'm not saying that it will (always,
> sometimes) fail, merely that a SELECT should be considered atomic.

  I would disagree.  It is a pretty common practice to step through a
  query and update other elements in the database.  I'm not just
  talking about SQLite either, this is a fairly common pattern in all
  database development.

  In the case of SQLite, it is all perfectly safe.  Updating the tables
  involved in the original query may result in some odd results, but 
  pretty much everything else is fair game.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to