December 2nd, 2008

SYSTEM_USER (user of oper. sys.)

Posted by admin in G. ANSI Scalar Functions

Use SYSTEM_USER to retrieve the current active user within the host operating system.
Example:

          SELECT SYSTEM_USER AS 'SysUser';

Result:

                   

> PostgreSQL, SQL Server, and Sybase support SYSTEM_USER.

> Access, DB2, MySQL, and Oracle don’t support SYSTEM_USER.

December 1st, 2008

SESSION_USER (Authorization ID)

Posted by admin in G. ANSI Scalar Functions

Use SESSION_USER to retrieve the current active Authorization ID, if it differs from the USER.
Example:

          SELECT SESSION_USER AS 'AuthID';

Result:

                   

> PostgreSQL, SQL Server, and Sybase support SESSION_USER.

> Access, DB2, MySQL, and Oracle don’t support SESSION_USER.

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.

Next Page »