aspose file tools*
The moose likes Android and the fly likes Checking for duplicates android sql using multiple columns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Checking for duplicates android sql using multiple columns" Watch "Checking for duplicates android sql using multiple columns" New topic
Author

Checking for duplicates android sql using multiple columns

Jason C Williams
Greenhorn

Joined: Feb 20, 2013
Posts: 1
I have an app that scans a bar code and enters the info in to a db in my app. What I need it to do is check the db for the information when the bar code is scanned, and then either write the info to the db or show a toast letting the user know that the bar code has already been scanned for this event, on this date, for this user and can not be entered in the db again. There are three columns that I need it to query against, date, event, and empID. I have gotten to where it will alert when a duplicate is found, but it is still writing to the db and the toast is staying on the screen a lot longer than it should. I have tried to add break; in the if statement after the toast and after where it is writing to the db, but it caused it to write to the db multiple times for some reason. This is my first attempt with android db and I am still new to SQLite as well, so any help someone can offer is greatly appreciated.


Here is the public cursor from my db helper class if needed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Checking for duplicates android sql using multiple columns