我正在尝试更改定义如下的 SQLite 表:
String CREATE_TABLE="CREATE TABLE IF NOT EXISTS " + tab_NAME + " ("
+ row_ID + " INTEGER PRIMARY KEY , "
+ row_NAME + " TEXT, "
+ row_EMAIL + " TEXT, "
+ row_WEBSITE + " TEXT, "
+ row_TELEPHONE1 + " TEXT, "
+ row_TELEPHONE2 + " TEXT, "
+ row_TELEPHONE3 + " TEXT, "
+ row_TELEPHONE4 + " TEXT, "
+ row_TELEPHONE5 + " TEXT);";
db_name.execSQL(CREATE_TABLE);
String newTab="CREATE TABLE IF NOT EXISTS temp ("
+ row_ID + " INTEGER PRIMARY KEY AUTOINCREMENT , "
+ row_NAME + " TEXT, "
+ row_EMAIL + " TEXT, "
+ row_WEBSITE + " TEXT, "
+ row_TELEPHONE1 + " TEXT, "
+ row_TELEPHONE2 + " TEXT, "
+ row_TELEPHONE3 + " TEXT, "
+ row_TELEPHONE4 + " TEXT, "
+ row_TELEPHONE5 + " TEXT);";
db_name.execSQL(newTab);
这是 auto_increment alter 语句:
String alter="ALTER TABLE temp AUTO_INCREMENT=1;";
ourDatabase.execSQL(alter);
我有一个错误说(1) near AUTO_INCREMENT: syntax error
怎么了??有什么帮助吗??