20190122 loop

时间:2023-03-09 14:14:34
20190122 loop

declare

a number;

v_begin date := to_date('201901013','yyyymmdd');

v_end date := to_date('20190119','yyyymmdd');

v_date date;

v_use varchar2(10);

begin

select v_end-v_begin into a from dual;

v_date :=v_begin;

for i in l.. a LOOP

v_use:=to_char(v_date,'YYYYMMDD');

dbms_output.put_line(v_use);

v_date:=v_begin + i ;

END LOOP;

end;