上一个问题:我正在关注 SQLite 教程,现在我想在表中再添加两列,但现在出现错误?这里有什么问题?请帮忙。
日志猫:
08-10 15:13:29.077: E/SQLiteLog(17055): (1) table country has no column named add
08-10 15:13:29.082: E/SQLiteDatabase(17055): Error inserting add=Feg dest=Fhd code=5495 cap=Egd name=A
08-10 15:13:29.082: E/SQLiteDatabase(17055): android.database.sqlite.SQLiteException: table country has no column named add (code 1): , while compiling: INSERT INTO country(add,dest,code,cap,name) VALUES (?,?,?,?,?)
08-10 15:13:29.082: E/SQLiteDatabase(17055): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
08-10 15:13:29.082: E/SQLiteDatabase(17055): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1012)
我的 SQLite java 类
@Override
public void onCreate(SQLiteDatabase db) {
String createQuery = "CREATE TABLE country (_id integer primary key autoincrement,name, cap, code, dest, add);";
db.execSQL(createQuery);
}