ASA SQL Reference
SQL Statements
Use this statement to display a message.
MESSAGE expression, ...
[ TYPE { INFO | ACTION | WARNING | STATUS } ]
[ TO { CONSOLE | CLIENT | LOG }]
TYPE clause The TYPE clause only has an effect if the message is sent to the client. The client application must decide how to handle the message. Interactive SQL displays messages in the following locations:
INFO The Messages pane. INFO is the default type.
ACTION A Message box with an OK button.
WARNING A Message box with an OK button.
STATUS The Messages pane.
TO clause This clause specifies the destination of a message:
CONSOLE Send messages to the database server window. CONSOLE is the default.
CLIENT Send messages to the client application. Your application must decide how to handle the message, and you can use the TYPE as information on which to base that decision.
LOG Send messages to the server log file specified by the -o
option.
The MESSAGE statement displays a message, which can be any expression. Clauses can specify where the message appears.
The procedure issuing a MESSAGE ... TO CLIENT statement must be associated with a connection.
For example, the message box is not displayed in the following example because the event occurs outside of a connection.
create event CheckIdleTime type ServerIdle where event_condition( 'IdleTime' ) > 100 handler begin message 'Idle engine' type warning to client; end;
However, in the following example, the message is written to the server console.
create event CheckIdleTime type ServerIdle where event_condition( 'IdleTime' ) > 100 handler begin message 'Idle engine' type warning to console; end;
Valid expressions can include a quoted string or other 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.
None.
None.
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Not supported in Adaptive Server Enterprise. The Transact-SQL PRINT statement provides a similar feature, and is also available in Adaptive Server Anywhere.
The following procedure displays a message on the server 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 server message window.