Quick Search:
 
 The Oracle PL/SQL SYSDATE Function      [Return To Index] Jump to:  

Term: SYSDATE

Definition:
In Oracle PL/SQL, SYSDATE is a pseudo column which always returns the operating system's current datetime value of DATE type. The format of the DATE output depends on the value of NLS_DATE_FORMAT initialization parameter.

Note that:

  1. The SYSDATE function requires no arguments.
  2. You cannot use the SYSDATE function in the condition of a CHECK constraint.

Example Syntax:

SYSDATE


Example Usage:

The SQL statement below shows the usage of SYSDATE. Note the value formatting done in the second SQL statement to get the Date time value.

SQL> SELECT SYSDATE FROM DUAL;

SYSDATE
---------
27-JAN-11

SQL> SELECT TO_CHAR(SYSDATE,'DD/MM/YYYY HH24:MI:SS') FROM DUAL

TO_CHAR(SYSDATE,'DD')
-------------------
27/01/2011 10:58:12


The SQL statement below will place the current date into the variable 'today_date':

SELECT SYSDATE
INTO today_date
FROM DUAL;



Related Links:

Related Code Snippets:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org