dimanche 15 février 2015

Android Sqlite : assign one column's values to another using ContentValues

I want to assign one column's values to another.


here is a query for it.



UPDATE contacts SET contactName=phone;


Here contactName and phone are two different columns.i am assigning phone column's values to contactName column.I can do this by using



db.rawQuery(query, null);


but if i want it to update it using



db.update(tableName, cValues, whereClause, whereArgs);


what should i put in Content values.If i put phone as a value then it will consider like



UPDATE contacts SET contactName="phone";


Help me to solve this issue. Any help will be appreciated.Thanks in advance


Aucun commentaire:

Enregistrer un commentaire