To display a message on the message window of the database engine or server.
MESSAGE expression, ...
Procedures, triggers, and batches.
Must be connected to the database.
None.
The MESSAGE statement displays an expression on the message window of the database engine or server (not on the client window). It is used primarily for debugging of procedures and triggers.
Valid expressions can include a constant, variable or function. However, queries are not permitted in the output of a Message statement even though the definition of an expression includes queries.
The following procedure displays a message on the engine message window:
CREATE PROCEDURE message_test ()
BEGIN
MESSAGE 'The current date and time: ', Now();
END
The statement
CALL message_test()
displays the string The current date and time, and the current date and time, on the database engine message window.