Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Next Month in PL/SQL

626082May 16 2008 — edited May 16 2008
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2008
Added on May 16 2008
17 comments
5,593 views