15.00 - CURRENT_USER - 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_USER

Purpose  

Provides the user name 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_USER are as follows:

 

Data Type

Format

Title

VARCHAR(30) CHARACTER SET UNICODE

X(30)

Current_User

Result Value

If you are accessing the Teradata Database through a proxy connection, CURRENT_USER returns the proxy user name. Otherwise, it functions exactly like the USER built-in function and returns the session user name. For details, see “USER” on page 379.

Example  

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

   SELECT CURRENT_USER;

The system responds with something like the following:

   Current_User
   ------------------------------
   BO-JSMITH

Example  

The following example selects the job title for the current authorized user:

   SELECT JobTitle FROM Employee WHERE Name = CURRENT_USER;