4
我嘗試更新數據庫表,這是我的代碼:android.database.sqlite.SQLiteException:無法識別的令牌:
public void updatefiletable(String filename, String v1, String v2){
AndroidOpenDbHelper androidOpenDbHelperObj = new AndroidOpenDbHelper(this);
SQLiteDatabase sqliteDatabase = androidOpenDbHelperObj.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(AndroidOpenDbHelper.COLLUMN_NAME_FILE_CLOUD, v1);
values.put(AndroidOpenDbHelper.COLLUMN_NAME_FILE_DATE_UPLOADING, v2);
sqliteDatabase.update(AndroidOpenDbHelper.TABLE_FILE, values, AndroidOpenDbHelper.COLUMN_NAME_FILE_NAME+"="+filename, null);
sqliteDatabase.close();
}
當我把我的方法與FILE_NAME值伊蓋爾priv_priv_secondfile_2012-06-15.pdf我得到那在logcat:
android.database.sqlite.SQLiteException: unrecognized token: "15.pdf": ,
while compiling: UPDATE file_table SET file_cloud_column=?,
file_date_upload_column=?
WHERE file_name_column=priv_priv_secondfile_2012-06-15.pdf
我該如何解決它?
謝謝,你幫我 – user1381760
它適用於我。謝謝 –