MySQL Forums
Forum List  »  Triggers

Re: #1064 - Algo está equivocado en su sintax cerca '' en la linea 4
Posted by: Alcy Salazar Martínez
Date: March 13, 2019 04:07PM

Ok
TKS




Now, I get the following error, removing the double quotes to (NEW.id_datos_personales).

This is the error:
# 1054 - The column 'id_datos_personales' in NEW is unknown.




DELIMITER //
CREATE TRIGGER `datos_personales_AFTER_INSERT` AFTER INSERT ON `datos_personales` FOR EACH ROW
BEGIN

DECLARE vUser varchar(50);
DECLARE VFECHACREACION varchar(20);
-- Find username of person performing the INSERT into table
SELECT SUBSTRING_INDEX(USER(),"@",1) INTO vUser;
select sysdate() INTO VFECHACREACION;

INSERT INTO audit_datos_personales (id_datos_personales, alive, apellido1, apellido2, nombre1, nombre2, genero, cod_dpto_nacimiento, cod_mpio_nacimiento, fecha_nacimiento, estado_conyugal, cod_dpto_residencia, cod_mpio_residencia, direccion_domicilio, telefono, telefono_movil, cod_grupo_etnico, cod_pais_nacimiento, creado_por, fecha_creacion, proceso_realizado)
VALUES(NEW.id_datos_personales, NEW.alive, NEW.apellido1, NEW.apellido2, NEW.nombre1, NEW.nombre2, NEW.genero, NEW.cod_dpto_nacimiento,NEW.cod_mpio_nacimiento, NEW.fecha_nacimiento, NEW.estado_conyugal, NEW.cod_dpto_residencia, NEW.cod_mpio_residencia, NEW.direccion_domicilio, NEW.telefono, NEW.telefono_movil, NEW.cod_grupo_etnico, NEW.cod_pais_nacimiento, vUser, VFECHACREACION, "INSERT - NUEVO");
END;


thank you for the attention and collaboration provided...

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: #1064 - Algo está equivocado en su sintax cerca '' en la linea 4
2229
March 13, 2019 04:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.