Let me come to the point directly.I am getting "No such column exception" even though the syntax of the query is right. The below is the table creation.
private void subCategory() {
String query = ("CREATE TABLE " + TABLE_SUB_CATEGORY + " ("
+ COL_SUB_CATEGORY_ID + " VARCHAR(50), "
+ COL_SUB_CATEGORY_NAME + " VARCHAR(250) , "
+ COL_SUB_CATEGORY_REFRENCE_ID + " VARCHAR(250) , "
+ COL_SUB_CATEGORY_IMAGE_PATH + " VARCHAR(300), "
+ COL_SUB_CATEGORY_IMAGE_DATA + " BLOB , "
+ COL_SUB_CATEGORY_DESCRIPTION + " VARHCAR(250) );");
database.execSQL(query);
}
And the place i am trying to get the values is .
Cursor cursor1 = db.query(DbHandler.TABLE_SUB_CATEGORY, null, " COL_SUB_CATEGORY_REFRENCE_ID " + "= ?", new String[] { categoryId }, null, null, null);
and i am using one more type of call.
String query = "SELECT * FROM " + DbHandler.TABLE_SUB_CATEGORY + " WHERE COL_SUB_CATEGORY_REFRENCE_ID = ? ";
Cursor cursor = db.rawQuery(query, new String[] { categoryId })
Both the approach doesnt seem working. i am getting "no such column exception". Can someone plese help me resolving this. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire