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!

While loop with Date counter in procedure

728768Nov 12 2009 — edited Nov 13 2009
hi guys

please find the below mention procedure in which i got one while loop which got increment counter as date variable .. i don't know what i am doing wrong but it is not working .

Can you please help me in this.

Regards







--------------------------------------------------------------------------------------------------
MY Procedure
--------------------------------------------------------------------------------------------------
create or replace
PROCEDURE sp_createTimeDim
(
--declare variables

DT IN DATE DEFAULT '01-01-1999 dd-mm-yyyy'

)
AS
BEGIN

WHILE DT <= '01-01-2010' LOOP
INSERT INTO DateDim ( ActualDate) VALUES ( sp_createTimeDim.DT );
/*increment the date one day*/

DT := DT +1;


END LOOP;
COMMIT;
END;
This post has been answered by Centinul on Nov 12 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2009
Added on Nov 12 2009
9 comments
3,842 views