Allows you to return messages from the database server messages window as a result set.
sa_server_messages( [ first_msg ] [, num_msgs ] )
first_msg Use this optional UNSIGNED BIGINT parameter to specify the ID of the first or last message to be returned, depending on the sign of the num_msgs parameter. The default is NULL, which means that the search starts at the beginning of the list if num_msgs is NULL or non-negative; the search starts past the end of the list if num_msgs is negative.
num_msgs Use this optional BIGINT parameter to specify the number of messages to be returned. The sign indicates whether the request is for messages starting at first_msg or ending at first_msg. The default is NULL, which means that all messages starting at first_msg to the end of the list are returned.
Column name | Data type | Description |
---|---|---|
msg_id | UNSIGNED BIGINT | Unique message ID. Message IDs start at 0. |
msg_text | LONG VARCHAR | Message text. |
msg_time | TIMESTAMP | Time when the message was issued. |
msg_severity | VARCHAR(255) |
Message severity. This column contains one of the following values:
|
msg_category | VARCHAR(255) |
Message category. This column contains one of the following values:
|
msg_database | VARCHAR(255) | Database name associated with the message if it applies to one specific database. Otherwise, NULL. |
When new messages are sent to the console, old messages with the same category or severity are deleted if the number of messages exceeds the value of the MessageCategoryLimit property. As a result, there may be gaps in the result set, and two consecutive rows may not have consecutive message IDs.
The STARTUP/SHUTDOWN message category does not show shutdown messages for servers. Shutdown messages are shown only if multiple databases are running on a server and one or more are shut down.
None
None
The following command requests 100 messages starting at the message whose ID is 3:
CALL sa_server_messages( 3, 100 ); |
The following command requests 500 messages up to, and including, message 4032:
CALL sa_server_messages( 4032, -500 ); |
The following commands request all messages starting with message 3:
CALL sa_server_messages( 3, NULL ); |
CALL sa_server_messages( 3 ); |
The following command requests the first 100 messages in the list:
CALL sa_server_messages( NULL, 100 ); |
The following command requests the last 100 messages in the list:
CALL sa_server_messages( NULL, -100 ); |
The following commands request all the messages in the list:
CALL sa_server_messages( NULL, NULL ); |
CALL sa_server_messages( ); |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |