Hello all. I am designing a set of tables within a SQLite database and would like to use Foreign Keys as a constraint with Xojo 2013r4.1 SQLite (3.7.17). Will I need to set the sqlite statement prior to Schema setup?
I put the command
PRAGMA foreign_keys = ON;
on the first line of the script creating my database and it’s there for good
(Script written with TextWrangler and install with .read command in the Terminal)
I close the database;
reopen it and querying the status sends me 1
PRAGMA foreign_keys;
1
So it’s stored in the database and it should never be put back to OFF.
jjc_Mtl
Oups!
update:
on a database I use regularly, I just test the PRAGMA foreign_keys; and it sent me 0 !!!
I always create my databases with foreign_keys ON
I tested the referential integrity by inserting data and foreign_keys is really OFF
SQLite allows me to INSERT any kind of stupidity…
So, just follow the rule (the SQLite one, not mine…)
sorry.
jjc_Mtl