'I have a syntax error when updating list of items when using room ( (1) near "?": syntax error ) [closed]
my error:
databaseE/SQLiteLog: (1) near "?": syntax error in "update posts_table set list = ?,? where id= ?"
my code:
@Query("update posts_table set list = :list where id= :id")
Completable updatePost(int id, ArrayList<Integer> list);
Solution 1:[1]
write like this
@Query("update posts_table set list = :list where id= :id")
void updatePost(ArrayList list,int id);
I recommend you to convert the arraylist into string and then add the data in db don't add direct the arraylist into it
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ryan M |
