On Thu, Jan 13, 2011 at 2:28 AM, Simon Slavin <slav...@bigfraud.org> wrote:
> > On 12 Jan 2011, at 10:54pm, Max Vlasov wrote: > > > On Thu, Jan 13, 2011 at 1:07 AM, Simon Slavin <slav...@bigfraud.org> > wrote: > > > >> [snip] If you're just > >> letting your user change whatever data they want, why are you bothering > to > >> keep track of rowids ? > >> > >> > > Thanks to the portability of sqlite, sometimes I just want to do things > easy > > at the fingers. So you have a grid, you walk on it, change values, > sometimes > > the program says "sorry, you can not do this", in other cases it just > does > > what it was asked for. And for for maintaining such simplicity one > sometimes > > have to implement a tricky algorithm like this :) > > I didn't make my question clear. Why are you keeping track of rowids > through changes. Since a change to any one record can make changes to any > number of records in any number of trees you have to redraw the screen after > every change anyway. So why are you bothering to keep track of the rowid of > just one of the records which were changed ? As you redraw the display you > can work out the new rowids. > > Maybe I didn't explain fully my situation. Sorry If I repeat some things already clarified, but it's also for Nicolas, who answered here too. It was about a single row change in an editable grid control (not some random user query). So the user is at some row of this grid changing values in the cells and making some 'apply" after changing. This apply ends with final "Update table set value1=...,value2=... where rowid=..." and the "rowid=" here because it's the best way to identify a row from the table for deleting and updating. After that apply I want to allow user to repeat the same steps (moving cursor from cell to cell, changing and pressing apply). Everything is ok if rowid is unaffected by the cells change (I just have full set of rowids for the whole table), but if some of cells represents the aliased rowid, this row becomes invalid after the change and I no longer can identify it for any next change. If I simply reread all the data (I don't want to since sometimes it takes time, but let's assume), I still won't be able to place the cursor at the changed row since with rowid changes it will no longer point to a valid row. To Nikolas Williams: I'd be glad to forbid rowid changes, but they're from virtually unknown aliased column. Max _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users