17.10 - getDBSSessionAttrInfo - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)
Returns information about the current session to a table operator. getDBSSessionAttrInfo returns a string in JSON format containing current session information, such as system variables and session attributes, including the following:
  • Current user name
  • Current role name
  • Transaction mode
  • Collation

Syntax

String getDBSSessionAttrInfo();

Usage Notes

For current role name, a maximum of 127 role names are returned. If a user is granted more than 127 roles and the user issues a SET ROLE ALL statement to enable all of the roles, "ALL" is returned for the current role name. For example, the following sample output shows the session information returned for TESTUSER who has more than 127 roles enabled:

{"CurUserName":"TESTUSER","CurRoleName":"ALL","TransactionMode":"BTET","Collation":"ASCII"}

For users who specify SET ROLE ALL but have 127 roles or less, "ALL" is returned along with each of the role names. For example, TESTUSER2 has 3 roles: Role1, Role2, and Role3.

{"CurUserName":"TESTUSER2","CurRoleName":["ALL","Role1","Role2","Role3"],"TransactionMode":"BTET","Collation":"ASCII"}