Returns the most recently-prepared SQL statement for each connection to the indicated database on the server.
sa_conn_activity( [ connidparm ] )
connidparm Use this optional INTEGER parameter to specify the connection ID number. The default is NULL.
Column name | Data type | Description |
---|---|---|
Number | INTEGER |
Renvoie l'identificateur (numéro) de la connexion en cours. |
Name | VARCHAR(255) |
Renvoie le nom de la connexion en cours. Temporary connection names have INT: prepended to the connection name |
Userid | VARCHAR(255) |
Renvoie l'ID utilisateur associé à la connexion. |
DBNumber | INTEGER |
Renvoie l'identificateur de la base de données. |
LastReqTime | VARCHAR(255) |
Renvoie l'heure du début de la dernière demande associée à la connexion spécifiée. Cette propriété peut renvoyer une chaîne vide pour les connexions internes, comme des événements. |
LastStatement | LONG VARCHAR |
Renvoie la dernière instruction SQL préparée pour la connexion en cours. |
If connidparm is less than zero, then information for the current connection is returned. If connidparm is not supplied or is NULL, then information is returned for all connections to all databases running on the database server.
The sa_conn_activity system procedure returns a result set consisting of the most recently-prepared SQL statement for the connection. Recording of statements must be enabled for the database server before 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.
Cloud note: Because of tenant database isolation rules, when this system procedure is run in the cloud it returns only information about
the current tenant database.
No privileges are required to execute this system procedure for the current connection ID. To execute this system procedure for other connections, you must have either the SERVER OPERATOR, MONITOR, or DROP CONNECTION system privilege.
None
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |