Have a database with table name status
and column name is column1
. I need to update this.
I have a String value in Activity1
<
You can Directly Execute
this Query like:
db.execSQL("update status SET column1 = '"+prms+"' ", null);
You should replace your code
Cursor cursor = db.execSQL("update status SET column1 = '"+prms+"' ", null);
With
db.execSQL("update status SET column1 = '"+prms+"' ", null);
void execSQL(String sql)
Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.
It has no means to return any data (such as the number of affected rows). Instead, you're encouraged to use insert(String, String, ContentValues, update(String, ContentValues, String, String[]), et al, when possible.