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

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

SQLiteDatabase update examples from Open Source projects
This code example shows how to use the following methods: beginTransaction, endTransaction, setTransactionSuccessful, update
126:	db.beginTransaction(); 
-
129:	int count = db.update("tests", values, newSelection, selectionArgs); 
130:	db.setTransactionSuccessful(); 
-
134:	db.endTransaction(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: beginTransaction, update
101:	db.beginTransaction(); 
-
103:	retval = db.update(table, values, selection, selectionArgs); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, update
94:	sqLiteDatabase.execSQL(sql.toString()); 
-
152:	userDao.save(sqLiteDatabase,account.getUser()); 
-
154:	int rowsAffected = sqLiteDatabase.update(TABLE, values, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: insert, update, close
217:	int row_count = db.update(TABLE_RECENT_RADIOS, values, "radio_id=?", whereArgs); 
-
220:	db.insert(TABLE_RECENT_RADIOS, null, values); 
-
223:	db.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: update
82:	int updatedCount = db.update(tableName, values, selection, selectionArgs); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isOpen, update
86:	if (mDatabase == null || !mDatabase.isOpen()) { 
-
334:	result = db.update(uriType.getTableName(), values, whereWithId(id, selection), 
-
338:	result = db.update(uriType.getTableName(), values, selection, selectionArgs); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, update
200:	db.execSQL(addColumnSql); 
201:	db.execSQL(addParentAccountSql); 
-
209:	db.update(ACCOUNTS_TABLE_NAME, cv, null, null); 
-
216:	db.execSQL(addPlaceHolderAccountFlagSql); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: put, update
58:	ContentValues cv=new ContentValues(); 
-
61:	cv.put("name", name); 
62:	cv.put("address", address); 
63:	cv.put("type", type); 
64:	cv.put("notes", notes); 
-
66:	getWritableDatabase().update("restaurants", cv, "_ID=?", 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, update, close
388:	db.beginTransaction(); 
-
391:	updated = db.update(mName, t.toContentValues(mTable), whereClause, whereArgs); 
-
394:	db.endTransaction(); 
-
396:	db.close(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: update
116:	return db.update(table, values, getSelection(), getSelectionArgs()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: update
182:	count = db.update(TABLE_NAME, values, selection, null); 
-
187:	count = db.update(TABLE_NAME, values, "_id=" + rowId, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: insert, rawQuery, update
137:	db.update("styles", cvs, "_id = ?", new String[] { id.toString() }); 
-
139:	id = db.insert("styles", null, cvs); 
-
141:	Cursor cursor = db.rawQuery("SELECT * FROM styles WHERE _id = ?", 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, update, close
59:	mDB.beginTransaction();//开始事务 
-
61:	mDB.update(TABLE_NAME, values, "_id = '"+id+"'", null); 
-
66:	mDB.endTransaction();//由事务的标志决定是提交事务,还是回滚事务. 
-
185:	mDB.close(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: update
80:	return mDb.update(tableName, values, selection, selectionArgs); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: put, update
108:	ContentValues content = new ContentValues(); 
109:	content.put( Field.date_last_read.toString(), new Date().getTime() ); 
-
112:	content.put(Field.progress.toString(), progress ); 
-
115:	getDataBase().update(LIB_BOOKS_TABLE, content, whereClause, args); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: update
230:	count = db.update(USERDICT_TABLE_NAME, values, Words._ID + "=" + wordId 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: update
186:	return mDb.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) > 0; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: replace, update
258:	int affected = mStoreDB.update(KEYVAL_TABLE_NAME, values, KEYVAL_COLUMN_KEY + "='" + key + "'", null); 
-
261:	mStoreDB.replace(KEYVAL_TABLE_NAME, null, values); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, setTransactionSuccessful, update
260:	database.beginTransaction(); 
-
264:	database.update(TABLE_WATCHLIST, values, KEY_WATCHLIST_SYMBOL + "=?", new String[] { symbol2 }); 
-
268:	database.update(TABLE_WATCHLIST, values, KEY_WATCHLIST_SYMBOL + "=?", new String[] { symbol1 }); 
-
270:	database.setTransactionSuccessful(); 
-
273:	database.endTransaction(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: query, update
48:	Cursor mCursor = database.query(DATABASE_TABLE, new String[] { KEY_ROWID, 
-
60:	return database.update(DATABASE_TABLE, initialValues, KEY_ROWID + "=" 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: update
177:	count = db.update(TABLE_NAME, values, "_id=" + rowId, null); 
Full Snippet Info
6
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: update
588:	return db.update(table, values, selection, selectionArgs); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: put, update
63:	ContentValues cv = new ContentValues(); 
64:	cv.put(CREATED_AT, created_at); 
65:	cv.put(TEXT, text); 
66:	getWritableDatabase().update(TABLE_NAME, cv, where, whereArgs); 
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, 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: put, update
41:	ContentValues cv = new ContentValues(); 
-
44:	cv.put("name", name); 
45:	cv.put("address", address); 
46:	cv.put("type", type); 
47:	cv.put("notes", notes); 
-
49:	getWritableDatabase().update("restaurants", cv, "_id=?", args); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: insert, insertOrThrow, rawQuery, update
163:	db.insertOrThrow(TASK_TABLE, null, values); 
164:	db.insert(FTS_TABLE, null, ftsVals); 
-
168:	Cursor cursor = db.rawQuery("SELECT version FROM " + TASK_TABLE + 
-
174:	db.update(TASK_TABLE, values, C_ID + " = " + id, null); 
175:	db.update(FTS_TABLE, ftsVals, C_ID + " = " + id, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: put, update
134:	ContentValues cv = new ContentValues(); 
135:	cv.put(EventsDB.ALARM_ACTIVE, alarmActive); 
136:	cv.put(EventsDB.ALARM_TIME_PRIOR, alarmTime); 
137:	return getWritableDatabase().update( 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: update
176:	db.update(TABLE_RECORDINGS, values, recordingIdClause(id), null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, setTransactionSuccessful, update
413:	db.beginTransaction(); 
414:	result = db.update(TABLE_NAMES[table], values, selection, 
-
416:	db.setTransactionSuccessful(); 
-
418:	db.endTransaction(); 
-
426:	db.beginTransaction(); 
-
428:	result = db.update(TABLE_NAMES[table], values, 
-
430:	db.setTransactionSuccessful(); 
-
432:	db.endTransaction(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: update
93:	int rows = db.update( "CLEANUP", args, "KEY=?", new String[] { key } ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: query, update
261:	Cursor cursor = db.query(TASKS_TABLE_NAME, null, 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: put, update
96:	ContentValues c = new ContentValues(); 
97:	c.put("ID", s.getId()); 
98:	c.put("NAME", s.getName()); 
99:	c.put("HOST", s.getHost()); 
100:	c.put("SSL", s.isSSL()); 
101:	c.put("PORT", s.getPort()); 
102:	c.put("USERNAME", s.getUsername()); 
103:	c.put("PASSWORD", s.getPassword()); 
104:	getWritableDatabase().update( "SERVERS", c, "ID  =  ?", new String[] { s.getId().toString() } ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: put, update
184:	ContentValues values = new ContentValues(); 
185:	values.put("MySchedule", checked ? 1 : 0); 
186:	if(sharedDb.update("Event", values, "_id="+id, null) == 0) 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: execSQL, update
74:	db.execSQL("ALTER TABLE subs ADD COLUMN _pvt text null"); 
-
77:	db.update(SUBS_TABLE, args, null, null); 
-
79:	db.execSQL("CREATE TABLE clips (_id integer primary key autoincrement, " 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isOpen, update, close
120:	if(db.isOpen()){ 
121:	db.update(TABLE_NAME, target, KEY_START_TIMESTAMP + "=?", new String[]{Long.toString(ae.getStartTimestamp())}); 
122:	db.close(); 
-
125:	db.close(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: insertOrThrow, update, close
142:	int affectedRows = db.update(TABLE_NAME, values, null, null); 
-
146:	db.insertOrThrow(TABLE_NAME, null, values); 
-
149:	db.close(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: update, longForQuery
295:	l1 = DatabaseUtils.longForQuery(sqlitedatabase, stringbuilder.toString(), as); 
-
302:	sqlitedatabase.update("photo", contentvalues, "photo_id=?", as); 
Full Snippet Info
4
CodeRank
Related SQLiteDatabase update Questions & Answers:
Other SQLiteDatabase update Examples
122:	
123:			// updating row return
124:			int update = db.update(TABLE_RSS, values, KEY_RSS_LINK + " = ?",
125:					new String[] { String.valueOf(site.getRSSLink()) });
126:			db.close();

Read More

116:	
117:			// updating row
118:			return db.update(TABLE_CONTACTS, values, KEY_ID + " = ?",
119:					new String[] { String.valueOf(contact.getID()) });
120:		}

Read More

7:	
8:			// updating row
9:			return db.update(TABLE_CONTACTS, values, KEY_ID + " = ?",
10:					new String[] { String.valueOf(contact.getID()) });
11:		}

Read More

Exposes methods to manage a SQLite database.

SQLiteDatabase has methods to create, delete, execute SQL commands, and perform other common database management tasks. See the Notepad sample application in the SDK for an example of creating and managing a database. Database names must be unique within an application, not across all applications. In addition to SQLite's default BINARY collator, Android supplies two more, LOCALIZED, which changes with the system's current locale, and UNICODE, which is the Unicode Co...
update Method Overview
Convenience method for updating rows in the database.
See Also
  • compileStatement
    Compiles an SQL statement into a reusable pre-compiled statement object.
  • delete
    Convenience method for deleting rows in the database.
  • execSQL
    Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.
  • getPath
    Gets the path to the database file.
  • inTransaction
    Returns true if the current thread has a transaction pending.
  • insert
    Convenience method for inserting a row into the database.
  • insertOrThrow
    Convenience method for inserting a row into the database.
  • isOpen
    Returns true if the database is currently open.
  • isReadOnly
    Returns true if the database is opened as read only.
  • query
    Query the given table, returning a Cursor over the result set.
  • rawQuery
    Runs the provided SQL and returns a Cursor over the result set.
  • replace
    Convenience method for replacing a row in the database.
  • setLockingEnabled
    This method was deprecated in API level 16. This method now does nothing. Do not use.