REPLACE FUNCTION SYSLIB.AbortListSessions ( HostIdIn SMALLINT, UserNameIn TD_ANYTYPE, SessionNoIn INTEGER, LogoffSessions VARCHAR(1) CHARACTER SET LATIN, UserOverride VARCHAR(1) CHARACTER SET LATIN ) RETURNS TABLE ( HostId SMALLINT, SessionNo INTEGER, UserName VARCHAR(128) CHARACTER SET UNICODE, AbortStatus CHAR CHARACTER SET LATIN ) ... ;
Syntax Elements
- HostIdIn
- Logical ID of a host (or client) with sessions logged on. A value of -1 indicates all hosts.
- UserNameIn
- User name of the session. An asterisk (*) or NULL indicates all users.
- SessionNoIn
- ID of the session to abort. A value of zero indicates all sessions.
- LogoffSessions
- Indicator of whether to log off sessions to Vantage after aborting them:
- Y = Log off and end sessions.
- N or NULL = Do not log sessions off.
- UserOverride
- Indicator of whether to override an ABORT SESSION failure:
- Y = Override the ABORT SESSION request to fail in any of the following cases:
- An identified session is being session-switched.
- An identified session is running its own ABORT SESSION request.
- An identified session has a PEState of IDLE: IN-DOUBT as a result of a 2PC.
Sessions are marked IN-DOUBT by the 2PC protocol, which governs how transactions are committed by multiple systems that do not share memory. The protocol guarantees that either all systems commit or all roll back.
- N or NULL = Do not override.
- Y = Override the ABORT SESSION request to fail in any of the following cases:
- HostId
- Logical host ID of (or client) the aborted sessions were logged on to. For a PE, HostId identifies one of the hosts or LANs associated with the described PE. For a session, the combination of a host ID and a session number uniquely identifies a user session on the system.
- SessionNo
- Number of the session that was aborted. With a given host ID, a session number uniquely identifies a session on the Teradata system. This value is assigned by the host (or client) at logon time.
- UserName
- User name of the session that was aborted.
- AbortStatus
- Status of the sessions aborted:
- I = In-Doubt
- A = Aborting a transaction
- C = Committing a transaction
- E = Executing (running) an ABORT SESSION request
- S = Switching
- An empty string = A state other than the preceding. This value returns when issuing an SQL function.