Foreign Key constraints are enabled or disabled for a connection to a database using the "PRAGMA foreign_keys = ON" SQL on the connection that should be doing the constraining. After that, only DBs that have tables with foreign key constraints in one or more Tables will be affected by the setting and only for the connection which enabled it.

This means that opening the Database from another application might ignore your foreign key constraints if the connection did not have it set to ON.

I don't think there exists a way to force constraining from the DB file itself... but I might be wrong, anyone else with insight on this would be appreciated.


On 2013/06/12 12:14, dd wrote:
Yes Simon. I am looking for it. ON DELETE RESTRICT.

I got the answer.

Should I enable foreign key support to use on delete restrict?(
http://www.sqlite.org/foreignkeys.html)

I have x databases without enabling foreign key support. Can I enable
foreign key support for x+1 database only?



On Wed, Jun 12, 2013 at 2:01 PM, Simon Slavin<slav...@bigfraud.org>  wrote:


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to