I want to insert or replace in SQLite by 2 fields Varchar and Integer. These 2 fields should be unique. So i have to create special table with 2 fields as unique ?
Maybe some one could help on this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want the combination of two fields to be unique, the easiest way is to create a unique index on these fields:
then in case of a conflict the
INSERT OR REPLACEstatement will replace the existing record with the new one.