tags:

views:

42

answers:

1

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?

+1  A: 

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.

Andrius
I wish it were that simple...Initially I had my primary key set as all 3, but when that didnt work I recreated the table and had no primary key, still didnt work.
dan