Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL

339 views Asked by At
 Delimiter$$
 create trigger salary_delete
 before delete
 on salary
 for each row begin
 insert into salary_dele(eid,validfrom,amount)
 value(old.eid,old.validfrom,old.amount);
 end if;
 end$$
 delimeter;

UNABLE TO FIND THE MISTAKE .PLEASE HELP

1

There are 1 answers

0
Akina On

Simply

create trigger salary_delete
 before delete
 on salary
 for each row 
 insert into salary_dele(eid,validfrom,amount)
 value(old.eid,old.validfrom,old.amount);

Single-statement compound statement does not need in BEGIN-END and DELIMITER.