ASA SQL Reference
SQL Functions
Alphabetical list of functions
Provides context information for event handlers.
EVENT_PARAMETER ( context-name )
context-name:
'AppInfo'
| 'ConnectionID'
| DisconnectReason
| 'EventName'
| 'Executions'
| 'NumActive'
| 'ScheduleName'
| 'TableName'
| 'User'
| condition-name
context-name One of the preset strings. The strings are case insensitive, and carry the following information:
AppInfo The value of the connection_property('AppInfo') for the connection which caused the event. This parameter is valid for Connect, Disconnect, ConnectFailed, BackupEnd, and RAISERROR events. The AppInfo string contains the machine name and application name of the client connection for Embedded SQL, ODBC, and OLE DB connections.
ConnectionId The connection ID, as returned by connection_property( 'id' )
DisconnectReason A string indicating the reason the connect was terminated. This parameter is valid only for Disconnect events. Possible results include:
from client The client application disconnected.
drop connection A DROP CONNECTION statement was executed.
liveness No liveness packets were received for the period specified by the -tl server option.
inactive No requests were received for the period specified by the -ti server option.
connect failed A connection attempt failed.
EventName The name of the event that has been triggered.
Executions The number of times the event handler has been executed.
NumActive The number of active instances of an event handler. This is useful if you want to limit an event handler so that only one instance executes at any given time.
ScheduleName The name of the schedule which caused an event to be fired. If the event was fired manually using TRIGGER EVENT or as a system event, the result will be an empty string. If the schedule was not assigned a name explicitly when it was created, its name will be the name of the event.
TableName The name of the table, for use with RemainingValues.
User The user ID for the user that caused the event to be triggered.
In addition, you can access any of the valid condition-name arguments to the EVENT_CONDITION function from the EVENT_PARAMETER function.
The following table indicates which context-name values are valid for which system event types. "User events" (indicated by quotation marks) are events which do not contain a TYPE clause.
context-name: | valid for event types: |
ConnectionID | BackupEnd, "Connect", "Disconnect", Global Autoincrement, "RAISERROR", user events |
User | BackupEnd, "Connect", ConnectFailed, "Disconnect", GlobalAutoincrement, "RAISERROR", user events |
EventName | all |
Executions | all |
NumActive | all |
TableName | GlobalAutoincrement |
AppInfo | BackupEnd, "Connect", ConnectFailed, "Disconnect", "RAISERROR", user events |
DisconnectReason | "Disconnect" |
Add the following message to the engine window output:'ev_PassedParameter - was trigger at: ' + event_parameter('Time');
CREATE EVENT ev_PassedParameter HANDLER BEGIN END; TRIGGER EVENT ev_PassedParameter("Time"=string(current timestamp));
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Not supported by Adaptive Server Enterprise.
EVENT_CONDITION function [System]