StuartBombay
Programmer
I think I know what's wrong here. The trigger doesn't know what I mean by the small_schools table. I needs someplace to hold the data from that table (cursor??) to check against, rather than checking against the small_schools table.
What I'm trying to accomplish is change the prognum for usernames if they are in the small_schools table.
I'm a bit lost with how to put this trigger together.
What I'm trying to accomplish is change the prognum for usernames if they are in the small_schools table.
I'm a bit lost with how to put this trigger together.
Code:
CREATE TRIGGER tr_small_schools
BEFORE INSERT ON people
FOR EACH ROW BEGIN
IF people.username In(small_schools.username)
SET people.prognum = small_schools.newprog;
END IF;
END;