RSS 응용 프로그램을 열 때 기사가 내 database에 있는지 확인하고 싶습니다. 그것을 삭제 (또는 무시)하고 싶다면 db에 쓰지 않으십시오.android.database.sqlite.SQLiteException : near "...": 구문 오류 (코드 1)
내가이 같은 일을하려고되었습니다
Cursor cursor = ourDatabase.rawQuery("select 1 from "
+ DBHelper.DATABASE_TABLE + " where " + DBHelper.TITLE + "='"
+ title + "'" + " AND " + DBHelper.DATE + "='" + date + "'",
new String[] {});
if (cursor.moveToFirst()) {
boolean exists = (cursor.getCount() > 0);
cursor.close();
return exists;
} else {
return false; }
}
을하지만 난이 오류를 얻을 :
06-06 16:01:11.341: E/AndroidRuntime(13867): Caused by: android.database.sqlite.SQLiteException: near "όσο": syntax error (code 1): , while compiling: select 1 from all_t where title='Ο ΦΟΒΟΣ και ο ΤΡΟΜΟΣ των διαδηλωτών!!! Αυτές οι γυναίκες είναι πιο σκληρές απ' όσο δείχνουν!' AND date='Wed, 05 Jun 2013 18:12:15'
고마워요! –
그래도 작동합니다, 가능하면 @WarrenFaith가 맞습니다. – njzk2