Messages in MySQL

0

In PostgresSQL I could raise exceptions from a triguer with the Raise Exception, so I ask how can I display a message from a trigger as it did in postgres with the Raise Exception in MySQL?

    
asked by Alex100 02.10.2017 в 00:06
source

1 answer

0

Put this text and you will get a message

DECLARE   msg VARCHAR (255);

SET msg = CONCAT ('The date can not be before', NOW ()); SIGNAL SQLSTATE '45000' SET message_text = msg;

    
answered by 02.10.2017 в 17:34