Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » System Procedures » System procedures

sa_column_stats system procedure Next Page

sa_conn_activity system procedure

Returns the most recently-prepared SQL statement for each connection to the specified database on the server.


sa_conn_activity( [ connidparm ] )

Result set
Column nameData typeDescription
NumberINTThe ID number of the connection.
NameVARCHAR(255)The name of the connection.
UseridVARCHAR(255)The user ID for the connection.
DBNumberINTThe ID number of the database.
LastReqTimeVARCHAR(255)The time at which the last request for the specified connection started.
LastStatement LONG VARCHARThe most recently-prepared SQL statement for the connection.

The sa_conn_activity system procedure returns a result set consisting of the most recently-prepared SQL statement for each connection, if the server has been told to collect the information. Recording of statements must be enabled for the database server prior to calling sa_conn_activity. To do this, specify the -zl option when starting the database server, or execute the following:

CALL sa_server_option('RememberLastStatement','ON');

This procedure is useful when the database server is busy and you want to obtain information about the last SQL statement prepared for each connection. This feature can be used as an alternative to request logging.

For information on the LastStatement property, from which these values are derived, see Connection-level properties.

If connidparm is not specified, then information is returned for all connections to all databases running on the database server. If connidparm is less than zero, option values for the current connection are returned.



Side effects


See also