create or replace
procedure time as

counter		number(10);
startdate	date;
quarter		number(2);
day		number(3);
month		number(3);
year		number(6);

begin
quarter := 0;
counter := 1;
startdate := to_date('01 01 1995','DD MI YYYY');


loop
day := to_char(startdate,'DD');
month := to_char(startdate,'MM');
year := to_char(startdate,'YYYY');
quarter := ceil(month / 3);
exit when year > 1997;

htp.print('insert into time values('||counter||','||day||','||month||','||quarter||','||year||');');
htp.br;
counter := counter + 1;
startdate := startdate + 1;

end loop;






exception
when others then
	htp.print('error: ' || sqlerrm);
end time;
/
show errors
