I've been wondering why my Cursor
returns an empty value If I Select
the hh_id
fields, it works on normal number like 1234
but I observed when the hh_id
consists of symbol -
it returns the cursor to null
even though it exists
String household_no ="";
household_no = edt_hh.getText().toString();
Cursor search = MainActivity.sqLiteHelper.getData("SELECT id,full_name,hh_id,client_status,address,sex,hh_set_group,current_grantee_card_number,other_card_number_1,other_card_holder_name_1,other_card_number_2,other_card_holder_name_2,other_card_number_3,other_card_holder_name_3,upload_history_id,created_at,updated_at,validated_at FROM emv_database_monitoring WHERE hh_id="+household_no);
while (search.moveToNext()) {
String emv_id = search.getString(0);
String full_name = search.getString(1);
String hh_id = search.getString(2);
String client_status = search.getString(3);
String address = search.getString(4);
String sex = search.getString(5);
String hh_set_group = search.getString(6);
String current_grantee_card_number = search.getString(7);
String other_card_number_1 = search.getString(8);
String other_card_holder_name_1 = search.getString(9);
String other_card_number_2 = search.getString(10);
String other_card_holder_name_2 = search.getString(11);
String other_card_number_3 = search.getString(12);
String other_cardholder_name_3 = search.getString(13);
String upload_history_id = search.getString(14);
String created_at = search.getString(15);
String updated_at = search.getString(16);
String validated_at = search.getString(17);
}
Log.v(ContentValues.TAG,"hahaha " +hh_id);
search.close();