Hi,
How can I get the next month in PL/SQL. For example this month is May, And Next month is June?
I tried something like this but didn't work.
DECLARE
Example_Date DATE;
This_Month Varchar(3);
Next_Month Varchar(3);
BEGIN
Example_Date := TO_DATE(SYSDATE,'MM');
Next_Month := TO_DATE(SYSDATE, 'MM'+1);
DBMS_OUTPUT.PUT_LINE('This Month is:' || Example_Date);
DBMS_OUTPUT.PUT_LINE('Next month is: ' || Next_Month);
END;
/
ERROR at line 6:
ORA-06550: line 6, column 56:
PLS-00306: wrong number or types of arguments in call to 'TO_DATE'
ORA-06550: line 6, column 42:
PL/SQL: Statement ignored