自已仔细研究吧: create or replace procedure getseq as i number:=0; str varchar2(50); begin i:=round(last_day(add_months(sysdate,-1))-trunc(add_months(sysdate,-1),'mm')); if to_char(sysdate,'dd')='01' then str:='alter sequence jsj_seq increment by -'||i; execute immediate str; end if; end; /
create or replace procedure getseq
as
i number:=0;
str varchar2(50);
begin
i:=round(last_day(add_months(sysdate,-1))-trunc(add_months(sysdate,-1),'mm'));
if to_char(sysdate,'dd')='01' then
str:='alter sequence jsj_seq increment by -'||i;
execute immediate str;
end if;
end;
/