Reputation: 91
I am trying to import large amounts of data into a sqlite DB through python 2.5. The data consists of strings, but there are multiple duplicates in the data. An example;
addres,type_code, location
123,01,work
123,01,mall
132,49,home
132,33,home
My issue is that when loading the data I get an Integrity error, address and type_code are not unique
. This is true, in fact there will be thousands of times when these 2 rows are not unique.
How am I able to enter this data into my database?
Upvotes: 0
Views: 1401
Reputation: 31
your table probably has primary key set as addres + typ_code. If those three fields are indeed should be unique in that particular table then redefine primary key to include all three fields addres, type_code and location. That would fix the problem you facing.
Upvotes: 3