lundi 9 mars 2015

SQLite Manager (Firefox) does not do UPDATE statement on multiple rows

I'm confused on how I seem to fail at doing a simple update in SQLite. I've installed SQLite Manager in Firefox and I want to update the moz_places table there because we recently changed 'provider' and instead of clearing my whole history in Firefox I thought it would be nice if I could simply update the information so the history points to the new location.


The idea is to run this code:



UPDATE moz_places SET url = REPLACE(url, '.old.com/', '.new.com/')


When I press [Run SQL] I've got the impression that nothing happens even though the Last Error field shows 'not an error'. Maybe it's simply very fast? Nope, when I then go into the data I find that it did not update a thing and my places folder is still full with old.com urls.


However, when I try



UPDATE moz_places SET url = REPLACE(url, '.old.com/', '.new.com/') WHERE id = 2458


it DOES update this one record.


Naively assuming that the SQLite syntax requires a WHERE I then added



UPDATE moz_places SET url = REPLACE(url, '.old.com/', '.new.com/') WHERE id > 0


but that didn't get me any results either.


Does SQLite only allow singe-row updates? Looking around on the internet I do not see such a limitation, but otherwise I'm not sure what could be the issue.


PS: I'm doing this on a copy of the /Profiles/ folder I found in %appdata%, not directly on the 'live' version. So locking should not be an issue either.


Aucun commentaire:

Enregistrer un commentaire