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.

November 27th, 2008

CURRENT_TIMESTAMP (date and time)

Posted by admin in G. ANSI Scalar Functions

Use CURRENT_TIMESTAMP to get the current date and time from the system clock of the computer where the DBMS is running.

Example:

     SELECT CURRENT_TIMESTAMP AS 'Timestamp';

Result:

                   

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

> Access doesn’t support CURRENT_TIME. Instead it uses NOW().

> MySQL also uses NOW().

> Oracle doesn’t support CURRENT_TIME, but it does support CURRENT_TIMESTAMP and SYSDATE.

November 26th, 2008

CURRENT_TIME (today’s time)

Posted by admin in G. ANSI Scalar Functions

Use CURRENT_TIME to get the current time from the system clock of the computer where the DBMS is running.
Example:

     SELECT CURRENT_TIME AS 'Time';

Result:

                   

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

> Access doesn’t support CURRENT_TIME. Instead it uses TIME().

> Oracle doesn’t support CURRENT_TIME, but it does support CURRENT_TIMESTAMP.

Next Page »