I want to retrieve a particular cell from a table. I want alarm_music(TEXT) where I have the hours(INTEGER) and the minutes(INTEGER)(In the where clause) of the alarm stored in the alarm table.
code where the query is fired
mBhelperClass = new AlarmsDBhelperClass(this);
db= mBhelperClass.getWritableDatabase();
Cursor cursor = db.rawQuery("SELECT musicPath FROM alarms WHERE hours="+hour+" AND minutes="+min,null);
Log.d("gaurnagSnooze",""+cursor.getCount());
if (cursor.moveToFirst()) {
songPath = cursor.getString(cursor.getColumnIndex(AlarmsDBhelperClass.MUSIC_PATH));
Log.d("if executed! ","songpath initialized!");
}
cursor.close();
the moveToFirst() returns FALSE meaning no rows in the table.
but when I fire SELECT musicPath FROM alarms the moveToFirst() returns TRUE.
how is this possible?