You are on page 1of 2

declare my_date number; m1 varchar2(100); y1 number; v_yy number; v_mm number; v_m2 varchar2(100); v_mon varchar2(100); i number :=1;

begin select to_number(to_char (add_months( (select gp.START_DATe from GL_PERIODS_V GP WHERE GP.PERIOD_SET_NAME = 'Eimco Calendar' AND GP.ADJUSTMENT_PERIOD_FLAG <> 'Y' and GP.PERIOD_name = 'Sep-11'--:period_name; ),12) ,'yyyy'))into my_date from dual; select to_number(to_char(to_date(:cp_month,'mon'),'mm')), to_number(to_char(to_d ate(:cp_year,'yyyy'),'yyyy')) into v_mm ,v_yy from dual;

dbms_output.put_line ('my date: ' ||my_date); while (i<=12) --for i in 1..12 loop if i >= 4 then y1 := v_yy; else y1 := my_date; end if; if i <=3 then y1 :=my_date; else y1 := v_yy; end if; if if if if if if if if if if if if (i=1) then (i=2) then (i=3) then (i=4) then (i=5) then (i=6) then (i=7) then (i=8) then (i=9) then (i=10) then (i=11) then (i=12)then V_m2 := 'January ' || y1; end if; V_m2 := 'February' || y1; end if; V_m2 := 'March ' || y1; end if; V_m2 := 'April ' || y1; end if; V_m2 := 'May '|| y1; end if; V_m2 := 'Jun '|| y1; end if; V_m2 := 'July ' || y1;end if; V_m2 := 'August '|| y1; end if; V_m2 := 'September '|| y1; end if; V_m2 := 'October '|| y1; end if; V_m2 := 'November '|| y1; end if; V_m2 := 'December '|| y1; end if;

--

--

/* select TO_CHAR(TO_DATE(evs.MONTH,'mm'),'MONTH') INTO v _mon from websupp.EIMCO_VENDOR_SCORECARD evs WHERE To_number(evs.YEAR) =2011 AND evs.MONTH = ( select decode(i,'Mar',4,'Apr',5,'May ',6,'Jun',7,'Jul',8,'Aug',9,'Sep',10,'Oct',11,'Nov',12,'Dec',null) from dual) and evs.item_id=1047075; */ --dbms_output.put_line ('after i : '||i ); dbms_output.put_line ('mon: '||v_m2); i:= i+1; END LOOP; end;

You might also like