开发者

Get Duplicate entries for some Items

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜