lundi 21 décembre 2015

android.database.sqlite.SQLiteException: no such column: personal (code 1):

I have a table created by this sql command -> CREATE TABLE messages( id integer primary key autoincrement, senderNum String, messagebody String, label String );

In this Table I have a row having senderNum equal to 123.In order to apply label to it i call method which looks like this ->

public void ApplyLabel(String senderNum){

        SQLiteDatabase db = this.getWritableDatabase();
        Cursor res = db.rawQuery("update messages set label=personal where senderNum=" + senderNum,null);



    }

where senderNum contains value 123.Now when this method is called it throws error like this -> android.database.sqlite.SQLiteException: no such column: personal (code 1): , while compiling: update messages set label=personal where senderNum=123

I don't know why it gives this error ??

Aucun commentaire:

Enregistrer un commentaire