Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

CURRENT_USER/USER

Description

CURRENT_USER and USER are used interchangeably. They return the user name that is currently logged in to the database as a string.

USER() and SYSTEM_USER() are used interchangeably. They return the user name with a host name.

Syntax

CURRENT_USER

USER

Example

--selecting the current user on the session

SELECT USER;

   CURRENT_USER

======================

  'PUBLIC'

 

SELECT USER(), CURRENT_USER;

   user()                CURRENT_USER

============================================

  'PUBLIC@cdbs006.cub'  'PUBLIC'

 

--selecting all users of the current database from the system table

SELECT name, id, password FROM db_user;

  name                           id  password

=========================================================

  'DBA'                        NULL  NULL

  'PUBLIC'                     NULL  NULL

  'SELECT_ONLY_USER'           NULL  db_password

  'ALMOST_DBA_USER'            NULL  db_password

  'SELECT_ONLY_USER2'          NULL  NULL