On Mon, Nov 24, 2014 at 1:22 PM, llanitedave
<llanited...@birdandflower.com> wrote:
> I recreated the table and put the foreign key reference directly into the 
> field definition:
>
> "of_borehole TEXT NOT NULL REFERENCES borehole,"
>
> This is a valid alternative according to the SQLite3 docs, if you don't 
> explicitly define the field name then it references to the primary key that 
> already exists in the referenced table.
>
> And that's all I had to do.  Strange, but it did the trick.

That's also perfectly valid according to the SQL spec. I prefer to put
the foreign key up there where possible (obviously it's not possible
with a multi-column FK, but those aren't common). Strange that the
other form doesn't work.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to