I have a method that runs a INSERT SQL statment that are got from external soruces and not from the android device. The incoming statments can cause duplicate records and I want the android device to ignore the sql statments if they cause duplicates. The method is:
ourDatabase.execSQL(sql)
The table its inserting the data into has the following column that prevents duplicates
KEY_CONCATA + " TEXT PRIMARY KEY , " +
Should this be unique and not primary key?
The system at the moment recognizes its causing a duplicate and ends the program, I want it to catch the error and stop it being inserted into the database if its a duplicate.
Thanks!
TEXT PRIMARY KEYand a primary key is unique by default... What is the error?