dimanche 12 avril 2015

INSERT in method rawQuery() does not work

I can not understand why I was trying to insert some records using the method rawQuery, for example:



db.rawQuery("INSERT INTO table (name, desc) VALUES ('Name1', 'Desc1');", null);


But this does not seem to work, in fact, trying with the insert() method works all:



ContentValues fields = new ContentValues();
fields.put("name", "Nome1");
fields.put("desc", "Desc1");
db.insert("table", null, fields);


And I wonder why this.


Aucun commentaire:

Enregistrer un commentaire