How did I not see that? Thank you for pointing that out. Adding the 
primary key to T1.f1 solved the problem. It was something so blatantly 
obvious in hindsight. I had primary keys on every other table except 
that one, but sometimes it's these little things that are the easiest to 
overlook.

Thanks again for that, Dan.

Kenneth

On 12/31/2010 10:48 PM, Dan Kennedy wrote:
> On 01/01/2011 11:27 AM, Kenneth Ballard wrote:
>> I apologize for not providing that initially. Here is the schema for the
>> three tables:
>>
>> CREATE TABLE [T3] (
>>      [f1] INTEGER NOT NULL CONSTRAINT [fk_T3_T2] REFERENCES [T2]([f1]) ON
>> DELETE CASCADE,
>>      [f2] INTEGER NOT NULL,
>>      [f3] INTEGER NOT NULL,
>>      [f4] INTEGER NOT NULL,
>>      [f5] INTEGER NOT NULL,
>>      [f6] INTEGER NOT NULL,
>>      CONSTRAINT [sqlite_autoindex_T3_1] PRIMARY KEY ([f1], [f2]));
>>
>> CREATE TABLE [T2] (
>>      [f1] INTEGER NOT NULL PRIMARY KEY,
>>      [f2] INTEGER NOT NULL CONSTRAINT [fk_T2_T1] REFERENCES [T1](f1]) ON
>> DELETE CASCADE,
>>      [f3] TEXT NOT NULL);
>>
>> CREATE TABLE [T1] (
>>      [f1] INTEGER NOT NULL,
>>      [f2] NUMERIC NOT NULL,
>>      [f3] TEXT NOT NULL);
> [T1].[f1] needs to be a PRIMARY KEY or have UNIQUE.
>
>     http://www.sqlite.org/foreignkeys.html#fk_indexes
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to