dimanche 6 mars 2016

Where clause is not working for long in android SQLite

I am trying for select statement in android SQLite i am able to select all records in a cursor if i do below

String tableName = "Test";
String[] columns = {mobile};//mobile has a datatype number in db

Cusrsor c = m_sqlLiteDatabase.query(tableName, columns, null,null, null, null, null);

c.getCount(); // 11

but does not return any value if i add a conditon as below

long mobile = 123456;
    m_sqlLiteDatabase.query(tableName, columns, "mobile=" + mobile ,null, null, null, null);

c.getCount(); // 0

is anything i am doing wrong? how to use long

Aucun commentaire:

Enregistrer un commentaire