开发者

Get Duplicate entries for some Items

开发者 https://www.devze.com 2023-03-23 03:21 出处:网络
I am new to android and working on an android application, I am parsing an xml and then storing data in the DB (SQLite). items i have in xml are basically slideshows. and i am saving individual slides

I am new to android and working on an android application, I am parsing an xml and then storing data in the DB (SQLite). items i have in xml are basically slideshows. and i am saving individual slides. Sometimes, it happens that i get one slide saved two times with different itemid(PK + autoincrement) but same data in other cloumns.

e:g

1 | www.abc.com | 25

2 | www.abc.com | 25

which should not be saved. i开发者_StackOverflow中文版 cant post original code. any general solutions to avoid that. Thanks in advance.


You can create table with UNIQUE column.And can handle error while inserting.In this case keep 2nd column also unique as you did with your first column

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号