MySQL Forums
Forum List  »  Spanish

Re: Problema con Trigger
Posted by: Alejandro Viera
Date: January 28, 2022 06:52PM

El Trigger:

CREATE DEFINER=`root`@`localhost` TRIGGER `articulos_graba_links` AFTER INSERT ON `articulos` FOR EACH ROW BEGIN
INSERT INTO links(codinterno,codigob,descripcion,MASTER) VALUES(NEW.codinterno,new.codigo,NEW.descripcion,NEW.codigo);
END

CREATE TABLE `links` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`codinterno` int(11) DEFAULT NULL,
`codigob` varchar(20) CHARACTER SET latin1 DEFAULT NULL,
`descripcion` varchar(60) CHARACTER SET latin1 DEFAULT NULL,
`master` varchar(20) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `porcodigob` (`codigob`),
KEY `porcodinterno` (`codinterno`),
KEY `pormaster` (`master`)
) ENGINE=InnoDB AUTO_INCREMENT=6105 DEFAULT CHARSET=latin1 COLLATE=latin1_bin

Lo que no puedo lograr es que el trigger me traiga los datos de la tabla de articulos, de los campos varchar. (`codigob`,`descripcion`,`master`)

Agradezco cualquier tipo de corrección / ayuda.

Options: ReplyQuote


Subject
Views
Written By
Posted
822
January 27, 2022 09:40PM
214
January 27, 2022 11:21PM
Re: Problema con Trigger
222
January 28, 2022 06:52PM
235
January 28, 2022 11:21PM


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.