Subject: Re: [sqlite] nested foreign keys
No, it means that you did not specify the whatisness of grandParent, parent, or
child; and/or, you have not enabled foreign_keys.
https://sqlite.org/lang_createtable.html
https://sqlite.org/pragma.html#pragma_foreign_keys
NB: I have compiled the CLI
to Hell but only a Stairway to Heaven says a
lot about anticipated traffic volume.
>-Original Message-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Roman Fleysher
>Sent: Wednesday, 24 October, 2018 22:30
>To: General Discussion
nt: Thursday, October 25, 2018 12:37 AM
> To: SQLite mailing list
> Subject: Re: [sqlite] nested foreign keys
>
> These statements worked for me:
>
>
> CREATE TABLE grandparent (id INTEGER PRIMARY KEY);
>
> CREATE TABLE parent (id INTEGER PRIMARY KEY REFERENCES grandpa
The statements work. Insertion fails.
Roman
From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of
David Yip [dw...@peach-bun.com]
Sent: Thursday, October 25, 2018 12:37 AM
To: SQLite mailing list
Subject: Re: [sqlite] nested
Dear SQLIters,
I am trying to set up what I would call "nested foreign keys":
create grandParent( id PRIMARY KEY)
create parent (id PRIMARY KEY REFERENCES grandParent(id))
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
These statements worked for me:
CREATE TABLE grandparent (id INTEGER PRIMARY KEY);
CREATE TABLE parent (id INTEGER PRIMARY KEY REFERENCES grandparent(id));
CREATE TABLE child (id INTEGER PRIMARY KEY REFERENCES parent(id));
The foreign key constraints work as you'd expect also.
What are you
Dear SQLiters,
I am trying to set up what I would call "nested foreign keys":
create grandParent (id PRIMARY KEY )
create parent (id PRIMARY KEY REFERENCES grandParent(id))
create child (id PRIMARY KEY REFERENCES parent(id))
SQLite complains. Does it mean that grand children are not allowed?
7 matches
Mail list logo