On 11 Sep 2011, at 2:49pm, Jay A. Kreibich wrote:
>> I think that the 'OR REPLACE' clause refers to the primary key,
>
> No, it will trigger on any UNIQUE constraint violation.
>
> My guess is that one of the individual columns has a UNIQUE constraint.
>
> Is "id" or one of the other columns defined as a PRIMARY KEY?
I agree with Jay. What's happening is this:
New row assembled.
Attempt to INSERT new row (first attempt)
INSERT fails UNIQUE contraint.
Notes that it was an INSERT OR REPLACE, therefore ...
DELETE original row.
Attempt to INSERT new row (second attempt)
INSERT works.
It might go around the loop more than once but it's something like that.
Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users