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, sqlite3_column_int(..., *0*) get the value of sn field.
using SQL query: "SELECT ROWID, * FROM a", i get the number of fields is 3.
it is also normal, sqlite3_column_int(..., 0) get the value of ROWID. but it
is equal to the value of sn field, which is set as "INTEGER primary key"
mentioned above. is it the meaning of "the field created as INTEGER primary
is alias to the hidden ROWID field"?
 
in the situation above, it is not easy or possible to implement a Move(int
nJumpto) function, which can move to any where in the table from the current
record(e.g. Move(-9) or Move(13)).

by the way, how to set the database have the feature of "VACUUM" with c/c++
API of sqlite3?



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/why-i-get-the-value-of-ROWID-is-equal-to-the-value-of-field-created-as-Primary-key-tp66361.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

Reply via email to