Google News
logo
PL/SQL - Interview Questions
Why is SYSDATE and USER keywords used?
SYSDATE :
* This keyword returns the current time and date on the local database server.
* The syntax is SYSDATE.
* In order to extract part of the date, we use the TO_CHAR function on SYSDATE and specify the format we need.
* Usage :
* SELECT SYSDATE FROM dual;
* SELECT id, TO_CHAR(SYSDATE, 'yyyy/mm/dd') from InterviewBitEmployeeTable where customer_id < 200;

USER :
* This keyword returns the user id of the current session.
* Usage :
* SELECT USER FROM dual;
Advertisement