SQLite Forum

Sqlite3 Trigger
Login
Hi,
first of all, thank you for your help. Much appreciated.

so... i think i forgot to mention:
the first versiion of my trigger was this:
CREATE TRIGGER 'InsertfehlerPruefung' BEFORE INSERT ON Pruefung
BEGIN
SELECT CASE 
WHEN (NEW.theorie = 0 AND (SELECT SUM(dauer) FROM fahrstunde WHERE fahrstunde.schueleremail = NEW.email ) < 180) 
THEN RAISE(ABORT, 'Nicht genug Fahrstundenminuten') 
END; 
END;

it was only when it didnt work that i changed it to "not >= 180".


Now.. i tried out your version with an emailadress from a student who only has 90minutes and it still gets inserted.