0
在Helper類的onUpgrade()方法中,我添加了一個新表。 不幸的是,logcat告訴我一個語法錯誤「ADD COLUMN」。Android SQLite onUpgrade(),創建新表
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (newVersion > oldVersion) {
db.execSQL("CREATE TABLE denze ADD COLUMN field1 TEXT," +
"ADD COLUMN field2 TEXT," +
"ADD COLUMN field3 TEXT," +
"ADD COLUMN field4 TEXT");
}
}