samedi 24 avril 2021

trigger with if else in mysql not executing

im fairly new at this and the trigger is created but it doesn't call past the first if clause for some reason ,mysql is not something i'm familiar with . i might sound stupid but can't figure out why

delimiter $$
CREATE DEFINER = CURRENT_USER TRIGGER `kel`.`kel_PL_monthlyupdate` 
BEFORE UPDATE ON  kel.kel_monthly_pl 
FOR EACH ROW
begin
if (new.jan>0)
then
update kel.kel_employee_balance_position
set janPL_cr=new.jan
where (sl_no=new.sl_no);
elseif 
(new.feb>0)
then
update kel.kel_employee_balance_position
set febPL_cr=new.feb
where (sl_no=new.sl_no);
end if;
end;

Aucun commentaire:

Enregistrer un commentaire