While loop with Date counter in procedure
728768Nov 12 2009 — edited Nov 13 2009hi 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;