Best code examples for SQLiteDatabase delete method (android.database.sqlite.SQLiteDatabase.delete)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SQLiteDatabase delete method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

SQLiteDatabase delete examples from Open Source projects
This code example shows how to use the following methods: delete, execSQL, rawQuery
448:	database.delete("exectable", null, null); 
-
450:	Cursor cursor = database.rawQuery("select * from exectable", null); 
-
454:	database.execSQL("insert into exectable (first_column) values (?);", new String[]{}); 
455:	Cursor cursor2 = database.rawQuery("select * from exectable", new String[]{null}); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, delete, insert, query
100:	db.delete(TABLE_PLAYLIST, "PlaylistName = ?", whereArgs); 
-
102:	db.close(); 
-
311:	Cursor query = db.query(TABLE_PLAYLIST, columns, "PlaylistName = ?", selectionArgs, null, null, null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: beginTransaction, delete, endTransaction, setTransactionSuccessful
281:	db.beginTransaction(); 
282:	db.delete(TABLE, COLUMN_USERID + "='" + userId + "'", null); 
283:	db.setTransactionSuccessful(); 
-
285:	db.endTransaction(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: delete, isOpen
86:	if (mDatabase == null || !mDatabase.isOpen()) { 
-
154:	result = db.delete(uriType.getTableName(), whereWithId(id, selection), 
-
158:	result = db.delete(uriType.getTableName(), selection, selectionArgs); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
107:	mDb.delete(PURCHASED_ITEMS_TABLE_NAME, PURCHASED_PRODUCT_ID_COL + "=?", 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
118:	count = db.delete(mTableName, 
-
124:	count = db.delete(mTableName, selection, selectionArgs); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, delete, endTransaction, setTransactionSuccessful
131:	database.beginTransaction(); 
-
134:	database.delete(TABLE_NAME, String.format("%s = ?", WALLPAPER_ID), new String[] { id }); 
135:	database.setTransactionSuccessful(); 
-
138:	database.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, delete, endTransaction, setTransactionSuccessful
178:	mDb.beginTransaction(); 
-
180:	mDb.delete(DATABASE_TABLE_RELATION, KEY_NOTEID + "=" + id, null); 
181:	mDb.delete(DATABASE_TABLE_NOTE, KEY_ROWID + "=" + id, null); 
182:	mDb.setTransactionSuccessful(); 
-
184:	mDb.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
34:	db.delete("subscriptions", null, null); 
35:	db.delete("pending_add", null, null); 
36:	db.delete("pending_remove", null, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete, query
142:	db.delete(TABLE_RECORDINGS, recordingIdClause(id), null); 
-
164:	Cursor cursor = db.query(TABLE_RECORDINGS, null, recordingIdClause(id), null, null, null, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, delete, endTransaction, setTransactionSuccessful
57:	database.beginTransaction(); 
58:	database.delete(table, whereClause, whereArgs); 
59:	database.setTransactionSuccessful(); 
-
61:	database.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: close, delete, insert, rawQuery
54:	c=sqdb.rawQuery("select count(*) from loginstat",null); 
-
60:	c=sqdb.rawQuery("Select time from loginstat order by time",null); 
-
64:	sqdb.delete("loginstat","time" + "=?",new String[] {temp} ); 
-
66:	sqdb.insert("loginstat",null,workhorse); 
-
69:	sqdb.close();///added on err 
-
78:	long temp3=sqdb.insert("loginstat",null,workhorse); 
-
80:	sqdb.close();///added on err 
-
87:	sqdb.close();///added on err 
-
94:	sqdb.close();///added on err 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, delete, endTransaction, setTransactionSuccessful
297:	db.beginTransaction(); 
-
311:	db.beginTransaction(); 
312:	result = db 
-
314:	db.setTransactionSuccessful(); 
-
316:	db.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: close, delete
100:	db.delete(TAB_NAME_MUSIC, "music_id=?", 
-
102:	db.close(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
123:	int count = db.delete(DATABASE_TABLE, COL_KEY + " = ?", new String[]{key}); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: close, delete
72:	db.close(); 
-
128:	Integer affectedRows=db.delete(TABLENAME, null, null); 
-
130:	dbh.onUpgrade(db, DATABASE_VERSION, DATABASE_VERSION); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: delete, update
411:	count = mDb.update(Apps.TABLE_NAME, deleteAppValues, selection, selectionArgs); 
-
416:	count = mDb.update(Apps.TABLE_NAME, deleteAppValues, 
-
429:	selectionArgs); 
-
433:	count = mDb.update(Apps.TABLE_NAME, deleteAppValues, 
-
441:	count = mDb.delete(Apps.TABLE_NAME, selection, selectionArgs); 
-
444:	count = mDb.delete(Logs.TABLE_NAME, selection, selectionArgs); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete, insert, query, update
271:	Long rowid = db.insert(getTableHistory(), null, values); 
-
354:	int deleted = db.delete(getTableHistory(), COLUMN_HISTORY_ID + " = '" + _id 
-
431:	return db.query(getTableSpieler(), columns, 
-
465:	Cursor c = db.query(getTableSpieler(), columns, getColumnSpielerId() + " = '" 
-
566:	db.update(getTableHistory(), cv2, COLUMN_HISTORY_SPIELER 
-
580:	db.update(getTableSpieler(), values, getColumnSpielerId() + " = " 
-
587:	return db.update(getTableSpieler(), cv, getColumnSpielerId() + " = '" 
-
602:	return db.update(getTableSpieler(), cv, getColumnSpielerId() + " = '" 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: delete
201:	count = db.delete("bookmarks", whereQuery, whereArgs); //$NON-NLS-1$ 
-
211:	count = db.delete("bookmarks", whereQuery, whereArgs); //$NON-NLS-1$ 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: delete, execSQL
71:	db.delete("history", "word = '"+word+"' AND pat = '"+pat+"'", null); 
-
75:	db.execSQL("insert into history(word,pat,patind,date) values ('"+word+"', '"+pat+"', "+patind+", datetime('now', 'localtime'));"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
196:	int rowCount = mDb.delete(DATABASE_TABLE_NAME, ID + " = " + uri.getPathLeafId()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: delete, insert, rawQuery, update
83:	mDatabase.update(TABLE_PLAKATE, cv, PLAKATE_ID + "=?", 
-
87:	mDatabase.delete(TABLE_CHANGES, CHANGES_ID + "=?", new String[] { String.valueOf(id) }); 
-
91:	mDatabase.insert(TABLE_CHANGES, null, values); 
-
174:	Cursor dataCount = mDatabase.rawQuery("select " + CHANGES_TYPE 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: delete
210:	db.delete(USER_TABLE, KEY_COREIDREFERENCE+"="+coreId, null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: close, delete
69:	db.close(); 
-
95:	db.delete(PREDICTIVE_WRITING_TABLE, null, null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: delete
264:	final int result = db.delete(getTableName(), BaseColumns._ID + " IS ?", 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: close, beginTransaction, delete, endTransaction
156:	db.beginTransaction(); 
-
158:	result = db.delete(UserDatabase.TABLE_USER_FTS, selection, selectionArgs); 
-
161:	db.endTransaction(); 
-
164:	db.close(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: longForQuery, delete
36:	long l = DatabaseUtils.longForQuery(sqlitedatabase, "SELECT count(*) FROM photo", null); 
37:	long l1 = DatabaseUtils.longForQuery(sqlitedatabase, "SELECT count(*) FROM album", null); 
-
39:	sqlitedatabase.delete("photos_of_user", "photo_of_user_id!=?", new String[] { 
-
42:	sqlitedatabase.delete("photos_in_stream", "photo_id IN ( SELECT photo_id FROM photos_by_stream_view WHERE owner_id!=? )", new String[] { 
-
45:	sqlitedatabase.delete("photos_in_album", "photo_id IN ( SELECT photo_id FROM photos_by_album_view WHERE owner_id!=? )", new String[] { 
-
48:	sqlitedatabase.delete("photos_in_event", "event_id NOT IN ( SELECT event_id FROM events )", null); 
49:	sqlitedatabase.delete("photo", "photo_id NOT IN ( SELECT photo_id FROM photos_in_album) AND photo_id NOT IN ( SELECT photo_id FROM photos_in_event) AND photo_id NOT IN ( SELECT photo_id FROM photos_in_stream) AND photo_id NOT IN ( SELECT photo_id FROM photos_of_user) AND photo_id NOT IN ( SELECT cover_photo_id FROM album) AND album_id NOT IN ( SELECT album_id FROM activities) ", null); 
50:	sqlitedatabase.delete("album", "owner_id != ? AND album_id NOT IN ( SELECT DISTINCT album_id FROM photo) ", new String[] { 
-
53:	long l2 = DatabaseUtils.longForQuery(sqlitedatabase, "SELECT count(*) FROM photo", null); 
54:	long l3 = DatabaseUtils.longForQuery(sqlitedatabase, "SELECT count(*) FROM album", null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: delete, setLockingEnabled
126:	mDatabase.setLockingEnabled(true); 
-
295:	result = db.delete(uriType.getTableName(), whereWithId(id, selection), 
-
306:	result = db.delete(uriType.getTableName(), selection, selectionArgs); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: delete, getPath, isOpen
216:	if( !db.isOpen() ) 
-
265:	int rows = db.delete(dbTable, selection, selectionArgs); 
-
269:	editor.putString(db.getPath(), "1:1:1"); 
Full Snippet Info
5
CodeRank
Related SQLiteDatabase delete Questions & Answers:
Other SQLiteDatabase delete Examples
159:		public void deleteSite(WebSite site) {
160:			SQLiteDatabase db = this.getWritableDatabase();
161:			db.delete(TABLE_RSS, KEY_ID + " = ?",
162:					new String[] { String.valueOf(site.getId())});
163:			db.close();

Read More

123:		public void deleteContact(Contact contact) {
124:			SQLiteDatabase db = this.getWritableDatabase();
125:			db.delete(TABLE_CONTACTS, KEY_ID + " = ?",
126:					new String[] { String.valueOf(contact.getID()) });
127:			db.close();

Read More

1:		public void deleteContact(Contact contact) {
2:			SQLiteDatabase db = this.getWritableDatabase();
3:			db.delete(TABLE_CONTACTS, KEY_ID + " = ?",
4:					new String[] { String.valueOf(contact.getID()) });
5:			db.close();

Read More

delete Method Overview
Convenience method for deleting rows in the database.
See Also