On Wed, Feb 03, 2010 at 08:51:46AM -0800, a1rex scratched on the wall:
> >----- Original Message ----
> >From: Pavel Ivanov <paiva...@gmail.com>
> >To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
> >Sent: Wed, February 3, 2010 11:37:17 AM
> 
> >Just first thought came to my mind: are you sure that 2 versions of
> >code mentioned do the same thing? In particular I'm asserting that
> >second version (under #if 1) doesn't do any actual updating and
> >doesn't change your database because you have wrong parameter indexes.
> 
> You are right! 
> Retraction. Mea Culpa. Back to square one??? 
> The modified code did not write anything to the drive! 
> But there was no error message from the SQLITE.

  Having an "UPDATE...WHERE" that modifies no rows is not any more
  of an error then one that modifies multiple rows.  You provided a
  valid SQL statement, SQLite executed it correctly.

> >And one more question: why don't you store your prepared statement
> >somewhere and do not prepare it for each row again and again?
> 
> I will. But the problem highlighted by my mistake with indexes is not
> with the prepared statement, but extremely slow write to the drive.

  If you are doing bulk updates, and are in a position to re-run the
  data in case of an error, wrap batches of 100 or more in a transaction.
  Just be sure to handle any error case that trips an automatic rollback.

   -j

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

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to