Skip navigation links

MySQL Forums :: Spanish :: Concatenar Campos con un Triggers


Advanced Search

Re: Concatenar Campos con un Triggers
Posted by: William Chiquito ()
Date: February 02, 2012 04:54AM

Hola Ivan,

El problema es que no puedes actualizar la misma tabla que activo el disparador (trigger), en este caso `clientes`, por ello el mensaje de error, revisa B.5.9: Can triggers access tables?

Una alternativa es aplicar la concatenaci├│n en el "BEFORE INSERT" del trigger de la siguiente manera:

/* Trigger structure for table `clientes` */

DELIMITER $$

/*!50003 DROP TRIGGER*//*!50032 IF EXISTS */ /*!50003 `combinarNombres` */$$

/*!50003 CREATE TRIGGER `combinarNombres` BEFORE INSERT ON `clientes`
FOR EACH ROW
BEGIN
	set new.`nomCompleto` = concat(new.`nbrClientes`, space(1) , new.`apeClientes`);
END */$$

DELIMITER ;

Espero te sea ├║til.

Options: ReplyQuote


Subject Views Written By Posted
Concatenar Campos con un Triggers 1771 Ivan J. Peraza N. 02/01/2012 05:21AM
Re: Concatenar Campos con un Triggers 752 William Chiquito 02/02/2012 04:54AM
Re: Concatenar Campos con un Triggers 401 Gonzalo Garcia Correas 02/02/2012 06:48PM
Re: Concatenar Campos con un Triggers 377 Ivan J. Peraza N. 02/03/2012 12:24AM
Re: Concatenar Campos con un Triggers 382 Gonzalo Garcia Correas 02/03/2012 11:41AM


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.