[sqlite] primary key and rowid

2011-12-18 Thread YJM YAN
//First way create primary key: CREATE TABLE t(x INTEGER PRIMARY KEY AUTOINCREMENT, y, z); x being an alias for the rowid? //Second way create primary key: CREATE TABLE t(x INTEGER, y, z, PRIMARY KEY(x AUTOINCREMENT)); x being an alias for the rowid?

[sqlite] lost primary key

2011-12-14 Thread YJM YAN
source table: DDL: create table xxx_table(id interger primary key autoincrement, field1, field2) int ret = sqlite3_exec(m_db,attach './backup.db' as filedb,0,0,NULL); ret = sqlite3_exec(m_db,begin transaction,0,0,NULL); ret = sqlite3_exec(m_db,create table filedb.xxx_table as select * from