0% found this document useful (0 votes)
55 views

Oracle/PLSQL: SYSDATE Function: Syntax

The SYSDATE function in Oracle/PLSQL returns the current date and time from the local database. It has a simple syntax of just SYSDATE and can be used in Oracle versions back to 8i. Examples show how SYSDATE returns the current datetime and can be combined with TO_CHAR to extract just the date portion.

Uploaded by

1raju1234
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Oracle/PLSQL: SYSDATE Function: Syntax

The SYSDATE function in Oracle/PLSQL returns the current date and time from the local database. It has a simple syntax of just SYSDATE and can be used in Oracle versions back to 8i. Examples show how SYSDATE returns the current datetime and can be combined with TO_CHAR to extract just the date portion.

Uploaded by

1raju1234
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Oracle/PLSQL: SYSDATE function

In Oracle/PLSQL, the SYSDATE function returns the current system date and time on your local database.

Syntax
The syntax for the SYSDATE function is: SYSDATE

Applies To

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example #1
The SYSDATE function can be used in Oracle/PLSQL. For example: select SYSDATE into v_date from dual; The variable called v_date will now contain the current date and time value.

Example #2
You could also use the SYSDATE function in any SQL statement. For example: select supplier_id, SYSDATE from suppliers where supplier_id > 5000;

Example #3
If you wanted to extract the date portion only (and exclude the time component), you could use the TO_CHAR function. For example: select supplier_id, TO_CHAR(SYSDATE, 'yyyy/mm/dd') from suppliers where supplier_id > 5000;

You might also like