I would like to get the value of the Count column from the cursor.
public Cursor getRCount(String iplace) throws SQLException { try { String strSql = "SELECT COUNT(_id) AS RCount FROM tbName WHERE place= '" + iplace + "'"; return db.rawQuery(strSql, null); } catch (SQLException e) { Log.e("Exception on query", e.toString()); return null; } }
I tried to get this count column value using the cursor as below
Cursor cR = mDbHelper.getRCount(cplace);if (cR.getCount() > 0){long lCount = cR.getLong(0);}cR.close();}
I got a debugging error. How to get it?
PS: Can I use nested cursors?
android cursor
soclose May 12 '10 at 9:20 a.m. 2010-05-12 09:20
source share