[sqlite] why i get the value of ROWID is equal to the value of field created as Primary key?

2013-01-02 Thread genliu777
i create a table in sqlite3 with the SQL query: "CREATE TABLE a(sn INTEGER primary key, name TEXT)". and add some records as follows, sn | name 11 | Jos 13 | Mar 15 | Sor using SQL query: "SELECT * FROM a", i get the number of fields is 2. it is normal,

Re: [sqlite] how to move around records in sqlite as the way as in CDaoRecordset of MFC??

2012-12-27 Thread genliu777
the reason that i talk about how to get ROWID of record is that i want to access specific record by the FASTEST way! i read the document of sqlite again, and find if i define a field(e.g. social_num) with the feature of "*integer primary key*" , i can access record by the value of the field in

Re: [sqlite] how to move around records in sqlite as the way as in CDaoRecordset of MFC??

2012-12-27 Thread genliu777
thanks!! as you sayed, knowing the ROWID means i can deal with the SQL query which you mention to move back or move forwark through the table! but, i do not get the ROWID really yet and further do not know how to get the ROWID by any API funtion supplied by sqlite3!!! -- View this message

Re: [sqlite] how to move around records in sqlite as the way as in CDaoRecordset of MFC??

2012-12-25 Thread genliu777
thanks, Simon Slavin-3! it is good idea to use " SELECT rowid FROM myTable WHERE rowid > *[current_rowid]* ORDER BY rowid LIMIT 1 " . but the key question is about the " current_rowid": how to get the value of rowid as the way as extracting other field value!! for example, ... ... int rowiddd

Re: [sqlite] how to move around records in sqlite as the way as in CDaoRecordset of MFC??

2012-12-25 Thread genliu777
thanks for consideration!! your reply gives some kind of view of solution. but how to get bookmark and set bookmark of record in table when "cursor" moves to the marked record directly from some other place in the table? -- View this message in context:

[sqlite] cursor question about sqlite3

2012-12-25 Thread genliu777
according to the forward-only iteration through sqlite table records, i wish i could realize some kind of funtions like next(), prev(), move(), getbookmark() and setbookmark(), to bi-directionally iterate through table. i searched through this forum of "cursor" question about sqlite. someone