SQL_CURRENT_USER

Name

SQL_CURRENT_USER — - returns the current user name.
   CURRENT_USER 
  

Inputs

None

Outputs

The name of the current user.

Description

The niladic CURRENT_USER function returns a string of type "name" whose value represents a user name identification.

Notes

Data type "name" is a non-standard 31-character type for storing system identifiers.

Usage

Display CURRENT_USER

   SELECT CURRENT_USER AS who_am_i;

   who_am_i
   ------------
   jose
  

Compatibility

SQL92

SQL92 specifies some additional niladic USER functions:

CURRENT_USER / USER

USER is a synonym for CURRENT_USER.

SESSION_USER

The SESSION_USER function returns the SQL-session user name.

SYSTEM_USER

The SYSTEM_USER function returns the database's initial default user.

A niladic USER function returns a SQL_TEXT character string whose value represents a user name.