Home > database >  MYSQL data trigger problems
MYSQL data trigger problems

Time:05-13

Each great spirit: good! I wrote a MYSQL trigger, but did not respond to the MYSQL database and execution, thought a lot of solution are not all quick collapse, please instruct me, thank you!

DELIMITER $$

USE ` esysdata ` $$

DROP the TRIGGER/*! 50032 IF the EXISTS */` tri_sendorder2021004 ` $$

The CREATE
/*! 50017 DEFINER='admin123456' @ '%' */
The TRIGGER ` tri_sendorder2021004 ` AFTER INSERT ON ` t_cy_sendstockentry `
FOR EACH ROW BEGIN
DECLARE c VARCHAR (40);
DECLARE v INT.
The SET c=' ';
The SET c=(SELECT FFileName FROM t_cy_order WHERE fbillno=new. Frelatebillno);
IF ISNULL (c) | | LENGTH (TRIM (c)) & lt; 1 THEN
The SET v=1/0;
END IF;
END;
$$

DELIMITER ;

CodePudding user response:

Make a train of thought, to write a simple query subject method content, have a look at whether the trigger structure problem, if there is a problem in a little bit of split view structure, if there is no problem to view the subject structure method, general subject method can be performed separately in the database, you can see the first database testing subject method on whether there is a problem, so hope to help you!

CodePudding user response:

Thanks for guidance! MYSQL trigger in consult, do you have a similar to SQL SERVER 'RAISERROR (' have linked data cannot be shut down the purchase order! ', 18, 19) 'message statement, and how to achieve ah, thank you!

CodePudding user response:

No this is private
  • Related