原文:http://www.jb51.net/article/31805.htm
范例:
CREATE OR REPLACE
procedure "INSERT_MONTH_BATTERYDATA_MONTH"(
YEAR IN number ,
MONTH IN number
)
as
DAY varchar2(40):=0;
i number(20);
begin
-- select (add_months(to_date(YEAR||MONTH, 'YYYYMM'),1)-to_date(YEAR||MONTH, 'YYYYMM')) into DAY from dual;--月份的天数计算出来
for i in 1..DAY LOOP
dbms_output.put_line('i='+i);
end LOOP;
end;