--- On Thu, 8/19/10, Simon Slavin <slav...@bigfraud.org> wrote:
> > On 19 Aug 2010, at 8:10pm, David Bicking wrote: > > > The way it is set up, if any of the updates/inserts > done by the triggers fail, everything rolls back, including > the original data that caused the triggers. What I want to > happen is that while everything else gets rolled back, > Table1 still has its data, along with the error messages > returned by the triggers. > > > > Nearest I can tell you can't do that with triggers, > but I really don't understand how they work, so maybe I am > wrong. > > You may be able to do this with ON CONFLICT and > RAISE. See > > http://www.sqlite.org/lang_createtrigger.html > I did read that, and think I mostly understand it, With it, and help from this list, I have gotten as far as I have. I haven't tried RAISE(ROLLBACK... as that seems to severe. RAISE(ABORT... removes the initial insert to Table1, which I want to avoid. RAISE(FAIL.. on lets say the fourth record inserted in to Table2, would leave the first three there, which I can't let happen. It is all or nothing for data changes below Table1. Which leads me to believe I can't do what I want without application code supervising the changes. > with special regard to those two constructions and see > > http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers > I do have foreign keys declared. Mind you in my tests they don't work if I forget to issue Pragma foreign_keys=on. Since I am a forgetful person, it seems like I really can't trust foreign keys and it is best to never enable them. Or is there a way to force them to be enabled at all times? (i.e. not trust me to remember to have any and all applications that talk to the data file to remember to issue the pragma statement.) Thanks, David _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users