[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] No conflict clause in foreign key clause?
From:       Dan Kennedy <danielk1977 () gmail ! com>
Date:       2010-05-29 8:43:16
Message-ID: 0B9FB4AF-D126-4A0E-98FC-AE8B2006DD05 () gmail ! com
[Download RAW message or body]


On May 28, 2010, at 10:54 PM, Robert Nickel wrote:

> I notice that the foreign key clause
> (http://www.sqlite.org/syntaxdiagrams.html#foreign-key-clause) does  
> not
> include a conflict clause
> (http://www.sqlite.org/syntaxdiagrams.html#conflict-clause). I always
> specify "ON CONFLICT ROLLBACK" with my other constraints, but what  
> will
> happen when a foreign key violation occurs within a transaction?  
> Will we
> see the default "ABORT" behavior as with other constraints?

Yes. A failed immediate FK constraint is like an ABORT
(statement rollback only).

> How do I get
> it to rollback the entire transaction in such a case?

Can't be done. You'll have to use triggers instead of
foreign keys if you need this.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic