15.00 - CURRENT_ROLE - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

CURRENT_ROLE

Purpose  

Returns the current role of the current authorized user.

Syntax  

ANSI Compliance

This is ANSI SQL:2011 compliant.

Result Type and Attributes

The data type, format, and title for CURRENT_ROLE are as follows:

 

Data Type

Format

Title

VARCHAR(30) CHARACTER SET UNICODE

X(30)

Current_Role

Result Value

If you are not accessing the Teradata Database through a proxy connection, CURRENT_ROLE functions exactly like the ROLE built-in function and returns the session current role, which is the current role of the session user. For details, see “ROLE” on page 370.

If you are accessing the Teradata Database through a proxy connection, then CURRENT_ROLE returns the current role of the proxy user as shown in the following table.

 

IF the current role for the session is …

THEN the result value is …

a role set by PROXYROLE

the name of the role.

the default

If there is one proxy role in the CONNECT THROUGH privilege of the proxy user, the result value is the name of the role.

If there are multiple proxy roles in the CONNECT THROUGH privilege of the proxy user, the result value is ALL.

PROXYROLE=ALL

ALL

PROXYROLE=NONE or NULL

NULL

Usage Notes  

CURRENT_ROLE is not supported in the FastLoad and MultiLoad utilities.

Example  

You can identify the current role for the current authorized user with the following statement:

   SELECT CURRENT_ROLE;

The system displays a response similar to the following:

   Current_Role
   ------------------------------
   Buyers_role