How to execute trigger in the procedure via PREPARE?

Tell me, please. Doing so

But, something does not come out even outside a procedure

SET @var = concat('DELIMITER | DROP TRIGGER IF EXISTS `trig`; CREATE TRIGGER `trig` BEFORE INSERT ON `table` FOR EACH ROW BEGIN IF (select count(*) from `table`)>99 THEN SIGNAL SQLSTATE \'45000\';END IF;END|');
PREPARE zxc FROM @var;
EXECUTE zxc;


Although it works

DELIMITER | DROP TRIGGER IF EXISTS `trig`; CREATE TRIGGER `trig` BEFORE INSERT ON `table` FOR EACH ROW BEGIN IF (select count(*) from `table`)>99 THEN SIGNAL SQLSTATE '45000';END IF;END|


Tell me, please. What is the trouble?
March 12th 20 at 08:42
0 answer

Find more questions by tags MySQL