Problems creating TRIGGER in MySQL -
i first time using trigger concept in mysql workbench below query,
first created people table using below query,
create table people (age int, name varchar(150));
then used below query trigger
delimiter create trigger agecheck before insert on raptor1_5.people each row if new.age < 0 set new.age = 0; end if; delimiter ;
but agecheck trigger not creating people table. not show error message when run query.
here table images,
updated : based on answer
try this.
use `raptor1_5`; delimiter $$ drop trigger if exists raptor1_5.agecheck$$ use `raptor1_5`$$ create trigger agecheck before insert on people each row begin if new.age < 0 set new.age = 0; end if; end$$ delimiter ;
Comments
Post a Comment