Contents Index LOOP statement OPEN statement [ESQL] [SP]

ASA SQL Reference
  SQL Statements

MESSAGE statement


Description 

Use this statement to display a message.

Syntax 

MESSAGE expression, ...
TYPE { INFO | ACTION | WARNING | STATUS } ]
TO { CONSOLE | CLIENT | LOG }]

Parameters 

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:

TO clause    This clause specifies the destination of a message:

Usage 

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.

Permissions 

None.

Side effects 

None.

See also 

CREATE PROCEDURE statement

Standards and compatibility 
Example 

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.


Contents Index LOOP statement OPEN statement [ESQL] [SP]