Error in 'semicolon' sintaxys and expected input end

2

I would like help to solve this trigger that throws me errors in the VALUES line says

  

"syntax error: missing 'semicolon' '

And in the last line in the END appears

  

"syntax error: extraneus input found - expected end of input ...

this is my script:

create trigger trigger_upd_profesor after update on profesor
for each row 
begin
insert into trigger_profesor(id_trigger,tipo_trigger,doc_prof,nom_prof,ape_prof,cat_prof,sal_prof)
values (null, 'update', new.doc_prof, new.nom_prof, new.ape_prof, new.cat_prof, new.sal_prof);
end;
    
asked by Camilo Duran 20.02.2017 в 05:41
source

1 answer

1

In this case you should use DELIMITER ; ( with space).

DELIMITER $$

create trigger trigger_upd_profesor after update on profesor
for each row 
begin
insert into trigger_profesor(id_trigger,tipo_trigger,doc_prof,nom_prof,ape_prof,cat_prof,sal_prof)
values (null, 'update', new.doc_prof, new.nom_prof, new.ape_prof, new.cat_prof, new.sal_prof);
end; $$

DELIMITER ;
    
answered by 20.02.2017 в 06:45