Learn how to use the Oracle/PLSQL SYSDATE function with syntax and examples.
The Oracle/PLSQL SYSDATE function returns the current system date and time on your local database.
The syntax for the Oracle/PLSQL SYSDATE function is:
There are no parameters or arguments for the SYSDATE function.
The SYSDATE function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle SYSDATE function examples and explore how to use the SYSDATE function in Oracle/PLSQL.
select SYSDATE into v_date from dual;
The variable called v_date will now contain the current date and time value.
You could also use the SYSDATE function in any SQL statement. For example:
select supplier_id, SYSDATE from suppliers where supplier_id > 5000;
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;