Skip to content

Pass Comma Deliminated String & IN SQL Query #58

@bhapps

Description

@bhapps

ReActiveAndroid Version:
latest
Bug or Feature Request:
Pass Array String for using WHERE.IN sql query

Description:
When using the below I get an exception error as where() seems to not accept all internal sql clauses types, although I have used BETWEEN before ..

Error

#################################################################
    Error Code : 1 (SQLITE_ERROR)
    Caused By : SQL(query) error or missing database.
    	(near "?": syntax error (code 1): , while compiling: SELECT * FROM Notes WHERE id IN ? ORDER BY id ASC LIMIT 20)
    #################################################################

String myCommaStingOfIds = "86973,86974,86975,86976,86977,86978,86979,86980";
where.("id IN ?", "(" + myCommaStingOfIds + ")");

Refer to http://www.tutorialspoint.com/sqlite/sqlite_where_clause.htm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions