SQLite User Forum

Sqlite3 Trigger
Login
as to how i know theorie is 0:
I manually insert a 0 like this:
INSERT INTO Pruefung(PruefungsID, Theorie, Gebuehr, Bestanden, Email)
VALUES(4, 0, 15.5, 1, 'schueler6@web.de');
and this should not be inserted if the trigger works right because schueler6@web.de has only 90 minutes.


i tried with your second version now. It still inserts the schueler6@web.de where theorie is 0.

But it does not insert this: 
INSERT INTO Pruefung(PruefungsID, Theorie, Gebuehr, Bestanden, Email)
VALUES(5, 1, 10, 1, 'schueler6@web.de');
which is what your second version of the trigger wants in the last part.

but it actually is all about when Theorie is 0.

what happens when theorie is 1 is another trigger that is only supposed to work, when the student hast at least done 3 distinct theorylessons..but well..thats another trigger that i didnt write yet.