mysql - Error in your SQL syntax near 'DELIMITER' -


i wanted create trigger database. code that:

delimiter ;  drop trigger  if exists `spi_financial_request_ains`;  delimiter $$  create     definer = current_user      trigger `spi_financial_request_ains` after insert on   `spi_financial_request`      each row begin                 declare ev_id int;                        if check_audit('spi_financial_request')=1                 insert spi_audit_event(table_name, record_id,event_type,user_id)               values('spi_financial_request',new.id,'ins',@user_id);                   select last_insert_id() ev_id; insert spi_audit_data(event_id,column_name,new_value)values(ev_id,'id',new.id); insert spi_audit_data(event_id,column_name,new_value)values(ev_id,'request_id',new.request_id); insert spi_audit_data(event_id,column_name,new_value)values(ev_id,'payment_type_id',new.payment_type_id);             end if;         end; $$  delimiter ; 

i've executed on local site (using sqlyog , 5.6.29 version of mysql). works.

but when tried use on dev server (using phpmyadmin , 5.6.32 version of mysql), i've got error:

#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'delimiter' @ line 1

i don't understand wrong.

delimiter mysql console command, can't use in phpmyadmin. set delimiter in phpmyadmin, see other answer


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -