AbortListSessions Syntax - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905
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.
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.
This value is NULL for AMPs. A value of zero represents the Supervisor window.
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.
For an ABORT without LOGOFF, any status except NULL indicates the reason the request did not impact the associated session.
For an ABORT with LOGOFF, an I, E, or S status value indicates that the associated session cannot be aborted or logged off.