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!

Incrementing a date variable

424486Jul 29 2004 — edited Jul 30 2004
Hi everyone,

How can we increment a date variable in a PL/SQL stored procedure. I need to loop through a pair of date using WHILE loop. I'm using following statement:

emp_leave_from_date := emp_leave_from_date + 1;

But its giving me the following error:

Compilation errors for FUNCTION UNILEVER.RET_NO_OF_DAYS

Error: PLS-00403: expression 'EMP_LEAVE_FROM_DATE' cannot be used as an INTO-target of a SELECT/FETCH statement
Line: 11
Text: select emp_leave_from_date + 1 into emp_leave_from_date from dual;

I even tried following statement but no success:

select emp_leave_from_date + 1 into emp_leave_from_date from dual;

Any help would b highly appreciated. Shall I use some other loop construct?

Thx.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2004
Added on Jul 29 2004
8 comments
1,395 views