On 12/18/08, Daniel Schnell <daniel...@marel.com> wrote: > Hi, > > is there a possibility to find out the difference before and after an > update of a table through the update callback ? > > I know that I can register a callback to a table for getting the rowid > of an SQLITE_UPDATE call. But the documentation doesn't state, if the > callback can still retrieve the old values to find out what these were > before the update occured. > > Is there a way to find these out ? > > >
I once had to do this (the silly client wanted to know the values of the row "just changed" by him!). I created a transaction whereby I first copied the row values to a temp table, then changed those row values, and then presented the old values stored in the temp table along with the new values in the actual table. Kludgy, but once implemented, it actually worked very well, especially with a web interface that showed the old values slightly greyed out just below the new ones. And, I also allowed a "rollback" to the old values until they were overwritten by another change. In other words, my undo buffer was only once change deep. -- Puneet Kishor http://www.punkish.org/ Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/ Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users