Am 10.06.12 14:49, schrieb Guenther Boelter: > On 06/10/2012 08:35 PM, Wolfgang Meiners wrote: >> So my question is: (how) can i write an integrity constraint in sqlite3 >> (version 3.6.12) which is equivalent to the part >> SELECT CASE >> WHEN EXISTS (SELECT * FROM ausleihen >> WHERE (beid = NEW.beid) AND (rueckgabe is\ >> NULL)) >> THEN RAISE(ROLLBACK, 'Buch ist ausgeliehen') >> END; >> of the trigger? >> >> > Moin Wolfgang, > > it's possible that I don't understand your problem, but why are doing a > rollback if you don't have changed anything in your database? > > Regards > > Guenther >
Hi Guenther, you are right, thank you for this hint. I started with an AFTER INSERT ON ausleihen Trigger. When i changed this to BEFORE INSERT ON ausleihen, i forgot to change ROLLBACK to ABORT (would FAIL be better?). I just changed this but the errormessage from sqlalchemy remains. Regards Wolfgang _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users