我想知道查詢以檢查DataBase中的特定記錄是否已存在或不是我的應用程序。選擇查詢以檢查SQLite數據庫中的現有記錄android
我已經爲這些做了一個功能,但它不能正常工作。
public boolean ifExisting(String name) {
Cursor c = db.rawQuery("SELECT * FROM " + TABLE_NAME + "WHERE" + "name" + "=" + name, null);
if(c.getCount() == 0)
return false;
else
return true;
}
這是我需要執行檢查複製過程功能的地方。
if(dh.ifExisting(dataVector.get(position)) == true) {
} else {
dh.insert(dataVector.get(position));
}
任何人都可以請幫助我。
感謝, 大衛
停止發送同樣的問題垃圾郵件!三後:http://stackoverflow.com/questions/4427875/query-to-check-the-existing-record-in-the-sqlite-database-in-android http://stackoverflow.com/questions/4427660/檢查數據庫中的記錄重複查詢 – WarrenFaith 2010-12-13 10:30:33
請不要一遍又一遍地提出同樣的問題。您可以編輯您的問題進行更新,您可以評論答案以獲取更多信息,如果找不到合適的答案,您可以提供賞金。 – Will 2010-12-13 12:40:56