1

Hi i am new to sqlite and i am having trouble with the IN (?) statement

my query is

where = SQLDB.KEY_POINT_BOX_ID_COLUMN + " IN (?) ";
whereArgs2 = {myStrings} // myStrings = [1,2]
Cursor cursor2 = db.query(SQLDB.DATABASE_TABLE_POINT,
            result_columns, where, whereArgs2, null, null,
            null);

This query doesn't return anything but if i change the above where statement to

where = SQLDB.KEY_POINT_BOX_ID_COLUMN + " = 1 ";

I get results

How do i use the IN(?) correctly?

user1634451
  • 5,133
  • 6
  • 30
  • 43

1 Answers1

0

I ended up not using whereArgs and just used this statement

where = SQLDB.KEY_POINT_BOX_ID_COLUMN + " IN ("+idValues+") "; // idValues = '1','2'
user1634451
  • 5,133
  • 6
  • 30
  • 43