CURRENT_USER
CURRENT_USER()
Section titled “CURRENT_USER()”Example
Section titled “Example”SELECT CURRENT_USER();Output
Section titled “Output”'exampleUser@localhost'Explanation
Section titled “Explanation”The CURRENT_USER() function is returning the user name and host name in the format ‘user@hostname’. In this example, the current user is ‘exampleUser’ and the host name is ‘localhost’.
CURRENT_USER()
Section titled “CURRENT_USER()”Example
Section titled “Example”SELECT CURRENT_USER;Output
Section titled “Output”'MyUser'Explanation
Section titled “Explanation”The CURRENT_USER function returns the name of the current user in the SQL Server session. In this case, the returned username is ‘MyUser’.
CURRENT_USER
Section titled “CURRENT_USER”Example
Section titled “Example”SELECT CURRENT_USER FROM dual;Output
Section titled “Output”'SCOTT'Explanation
Section titled “Explanation”The CURRENT_USER function in Oracle returns the name of the user who executed the current SQL statement. In this example, the user “SCOTT” executed the SQL statement.