Usama Sarwar
Usama Sarwar

Reputation: 9020

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 cant post original code. any general solutions to avoid that. Thanks in advance.

Upvotes: 0

Views: 105

Answers (1)

Rasel
Rasel

Reputation: 15477

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

Upvotes: 1

Related Questions