 <p>As far as I know the COL_NAME can't be replaced with "?". Android only takes "?" as "arguments", not as "selection"</p> <pre><code>final String query = "SELECT * FROM " + TBL_NAME + " WHERE COL_NAME=?"; final String[] args = new String[] {Long.toString(id)}; final Cursor c = db.rawQuery(query, args); </code></pre> <p>Or better use this method</p> <pre><code>query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy) </code></pre> <p>In your case it would be like this:</p> <pre><code>final String[] args = new String[] {Long.toString(id)}; final Cursor c = db.query(TBL_NAME, null, COL_NAME + "=?", args, null, null, null); </code></pre>