2009/12/2 Ubirajara Marques da Cruz <birac...@cemig.com.br>:
> To Support,
>
>
>
> I am trying to develop a data base what need to specify  foreign key to 
> preserve problems with insertion of datas.
>
>
>
> I have four tables like i describe below:
>
.
.
.
>
> When i start sqlite3 and inside sqlite prompt line i create data base with 
> this conditions and enable foreign key feature data base return error when i 
> try to put some datas out of range and return fail because foreign key isn´t 
> respected. But when i create data base right with sqlite3.exe dB.db  "SQL 
> STATMENT" command, foreign key is not respected.
>
>
> Why this happen?
>

http://www.sqlite.org/pragma.html#pragma_foreign_keys indicates that
the setting applies to the connection, not the database.

Each time you issue <sqlite3.exe dB.db  "SQL STATMENT"> command, a new
connection is created.

Try <sqlite3.exe dB.db  "pragma foreign_keys=1; SQL STATMENT">

>
> Thanks in advance.
>
> Eng° Ubirajara Marques da Cruz
>

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

Reply via email to