Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL SYSDATE Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

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      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 62 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?