Might I suggest using MD5 (or other) hashing algorithms in your application as a way to check whether data in your application's memory is different from what's in the database?
There are also locking mechanisms you can use to avoid (or create!) concurrency problems. If you're not worried about two processes operating on the same row(s), this all shouldn't really be much of an issue for you. In any event, I think you're looking to implement some means for your application to tell whether the data is dirty or not, and ROWNUM or a similar feature would not be more helpful than a primary key. For the record, you can do a lot of convenient things using ROWNUM in Oracle :-) Cheers, Billy On Thu, Feb 19, 2009 at 9:09 PM, His Nerdship <slgdoug...@optusnet.com.au>wrote: > > OK, thanks for the info. > I will just do what I said before, namely read the whole table (it won't be > too big) and extract the required row from the returned array. > The reason I wanted a row ID was that all the fields in the display grid > can > be edited, so by the time I come to process it, any of them might have > changed from the original in the database so I can't use them in a WHERE > clause. > At least I know now.... > Thanks again > > > P Kishor-3 wrote: > > > > On Thu, Feb 19, 2009 at 6:54 PM, His Nerdship > > <slgdoug...@optusnet.com.au> wrote: > >> > >> Hi, > >> I am converting a program from Paradox (stop laughing, please) to > SQLite. > >> Paradox has a useful feature where you can specify the actual index of a > >> row > >> in the table. This is handy when the table is displayed in a grid and > >> you > >> want the record corresponding to a row in that grid - you can just > >> specify > >> the index, say 28, of that grid row and it will get the record no 28 > from > >> the table. It spares the need for a SELECT statement, and is a lot more > >> efficient. > >> As a SQLite newbie, the only way I can see to do this is to read the > >> whole > >> table with sqlite3_get_table() and then get the required row from the > >> returned array. This seems overkill when I just want a single record. > > > > There is the rowid, but I am not sure what you want to do... are you > > expecting a database table to be a linear list of entries? Generally > > one uses a spreadsheet for that kind of stuff. A SQL database doesn't > > have an internal concept of order. You specify a criteria and the db > > returns a SET of rows or records. You can constrain the SET by > > specifying criteria (the WHERE clause), and you can impose an order on > > the returned rows by specifying an ORDER clause. > > > > If you want just one specific row, just do a > > > > SELECT cols FROM table WHERE some_primary_key = ? > > > > If you don't want to specify and control your own primary key, you can > > use the rowid which is something the db uses internally for its own > > shenanigans. > > > > > >> Is there a more compact way of doing this? > >> Thanks in advance etc. > >> Sholto > > > > > > > > -- > > 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/ > > Sent from: Madison Wisconsin United States. > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > -- > View this message in context: > http://www.nabble.com/Any-concept-of-row-number-in-SQLite--tp22112862p22113562.html > Sent from the SQLite mailing list archive at Nabble.com. > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Billy Gray wg...@zetetic.net _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users