Quoth Joe Bennett <jammer10...@gmail.com>, on 2010-12-24 18:28:18 -0600: > Have a question regarding a particular issue I am dealing with... I > have a database in which I create a pivot table to get a no dupe list > using a 'select distinct'. I then take that list into Python and then > iterate over it to look up data in another table to add in the > latitude and longitude for each entry. Each entry could have over a > thousand 'dupes' that I am trying to update with the lat/lon... > Anyway, what I have noticed is that when I run the following Python > 'SQLite command' sometimes all the 'dupes' get updates and sometimes > some do and some don't as well as sometimes none get updated... I am > able to replicate this with the same SQLite command in SQLite Manager: > > update_data = 'update matrix set %s = %f, %s = %f where %s = "%s"' % > (A_B + '_Lat', Lat_Site, A_B + '_Lon',Lon_Site, A_B, Site[0])
This is pretty hard to determine from just that statement. Actually showing us your schema would help, and some example rows that you expect to be updated by a particular query (after all the substitutions), the results that you get instead, and how you got the results back out of the database to check (including full SELECT query if relevant). But first things first. *cues the instrumental accompaniment* o/` Oompa loompa doopity doo I've got another puzzle for you Oompa loompa floopity fliss If you are wise you're watching for this What do you get writing SQL strings Attempting to earn both your lexical wings Could be a typo that doubled your quotes Or maybe you misread the notes In the FAQ list... http://sqlite.org/faq.html#q24 Oompa loompa bloopity blurn SQL syntax is easy to learn It might help your queries work too Like the oompa loompa oompa Oompa loompa doopity do o/` ---> Drake Wilson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users