this is my trigger
CREATE TRIGGER proximo_pago
AFTER INSERT ON pago FOR EACH ROW
BEGIN
DECLARE max_orden integer;
DECLARE num_lote =NEW.lote;
BEGIN
SET max_orden = (SELECT MAX(orden) FROM PAGO WHERE LOTE=num_lote);
SELECT max_orden INTO : NEW.orden from dual;
END
END
and the error
Error SQL query:
CREATE TRIGGER proximo_pago
AFTER INSERT ON pago FOR EACH ROW
BEGIN
DECLARE max_orden integer;
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
;on your first declare is terminating the entire trigger definition.delimiter /and put that character also at the end of your trigger definition.