SQLiteDatabase database = this.getReadableDatabase();
Cursor cursor = database.rawQuery(selectAll + DatabaseSchema.Vehicles.TABLE_NAME + " where " + DatabaseSchema.Vehicles.COLUMN_ID + "=" + id, null);
cursor.moveToFirst();
Here, selectAll = "select * from "
, and COLUMN_ID
is has int datatype. This code returns an empty cursor everytime. Even though data is inserted in table. When I run query with only "select * from tablename
". It gives me data.
Aucun commentaire:
Enregistrer un commentaire