我收到提示:SQLite的例外嘗試刪除行
android.database.sqlite.SQLiteException: near ":BE": syntax error (code 1): , while compiling: DELETE FROM device WHERE address=C4:BE:84:18:D5:A5
,同時試圖從SQLite數據庫中刪除的行。
public int removeDevice(String address) {
open();
int removedId = database.delete(MySQLiteHelper.TABLE_DEVICE
, MySQLiteHelper.KEY_ADDRESS + "=" + address, null);
close();
return removedId;
}
我找不出什麼問題。
是'address'一個字符串?需要引用字符串 –
@VladMatvienko是的,確實如此:這是一個MAC地址。 –