Mysql触发器与从属上的子查询

时间:2018-11-07 13:10:09

标签: mysql triggers subquery

我在从机上有一些触发器。 它不会触发子查询。 没有子查询,它就可以工作。

谢谢

INSERT INTO s_address (lastname,address,telephone,city)
  VALUES('yilmaz','my new address','905548185555',
   (SELECT `city_name` FROM s_city WHERE city_id='58')
 ) ;



DELIMITER $$
   CREATE TRIGGER `s_address_BEFORE_INSERT` BEFORE INSERT ON 
  `s_address` FOR EACH ROW
BEGIN
   SET NEW.lastname = mask_lastname(NEW.lastname);
   SET NEW.address = mask_address(NEW.address);
   SET NEW.telephone = mask_tel(NEW.telephone);
END$$

0 个答案:

没有答案