November 28th, 2008

CURRENT_USER or USER

Posted by admin in G. ANSI Scalar Functions

Use CURRENT_USER or USER to retrieve the current active user of the computer where the DBMS is running.

Example:

     SELECT CURRENT_USER AS 'User';

Result:

                   

> DB2, MySQL, PostgreSQL, SQL Server, and Sybase support CURRENT_USER.

> Access doesn’t support CURRENT_USER. Instead it uses CURRENTUSER.

> DB2 uses SELECT CURRENT_USER FROM SYSIBM.SYSDUMMY1;.

> Oracle doesn’t support CURRENT_USER, but it does support SELECT USER FROM DUAL;.

> CURRENT_USER and USER are synonymous.

Leave a reply

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: