Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Change a value in a column in sqlite

Easy solution:

String sql = "UPDATE "+TABLE_NAME +" SET " + ColumnName+ " = '"+newValue+"' WHERE "+Column+ " = "+rowId;

Better solution:

ContentValues cv = new ContentValues();
cv.put(ColumnName, newValue);
db.update(TABLE_NAME, cv, Column + "= ?", new String[] {rowId});

Tags:

Sqlite

Android

Related

How do I get the value of text input field using JavaScript? How do I detect XML parsing errors when using Javascript's DOMParser in a cross-browser way? Visualization of 3D-numpy-array frame by frame Why write 'at' and 'dot' in email rather than '@' and '.'? What are Replacement Functions in R? How to convert an array of arrays or objects to an associative array? Running a cron job on Linux every six hours Calculate the mean by group vim CTRL-] keys not working MPMediaItem | iCloud or DRM Protected Change Activity's theme programmatically Add new row to dataframe, at specific row-index, not appended?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy