0

I have a problem with alert in python. The goal is to have a notification that will tell me when I enter radno_mesto = 'programer'. However, I am not getting any notification. What's the problem with the code?

import sqlite3
konekcija = sqlite3.connect('data/napredni_zaposleni.sqlite')
baza = konekcija.cursor()
baza.execute("""CREATE TABLE zaposleni (
                    id INTEGER PRIMARY KEY,
                    ime TEXT,
                    prezime TEXT,
                    radno_mesto TEXT
                )
                """)
baza.execute("""CREATE TRIGGER moj_alert_okidac
                    AFTER INSERT ON zaposleni
                    FOR EACH ROW
                    WHEN (NEW.radno_mesto = 'programer')
                    BEGIN
                        SELECT 'U tabelu zaposleni je umetnut programer.' AS alert_message;
                    END;
                """)

baza.execute("""INSERT INTO zaposleni (ime, prezime, radno_mesto)
                VALUES ('Nikola', 'Janković', 'programer')
                """)
konekcija.commit()
konekcija.close()```




I want to have alert when I insert radno_mesto = "programer".

Why there is no any alert in jupyter ouput?

0 Answers0