Reputation: 13143
Is there a way for selecting the rowid from table using SQLiteDatabase instance
Cursor websiteCursor= mDatabaseManipulator.query(mTableName, null, COLUMN_WEBSITENAME+"='"+websiteName+"'", null, null, null, null);
Above cursor doesn't get the rowid. The doc says passing null in second argument will return all columns. But rowid is not returned.
I m getting rowid using rawQuery.
Cursor websiteCursor = mDatabaseManipulator.rawQuery("Select rowid _id, * from " + mTableName + " where " + COLUMN_WEBSITENAME + " = '" + websiteName +"'", null);
Upvotes: 0
Views: 124
Reputation: 9336
I think there is some problem in the way that you are implementing the cursor, try this :-
Cursor websiteCursor= mDatabaseManipulator.query(mTableName, new String[]{rowid_id}, COLUMN_WEBSITENAME+" =? ", new String[]{websiteName}, null, null, null);
Upvotes: 1