简单写一个,其余的楼主自己填吧 CREATE OR REPLACE PROCEDURE p_test(pstrYearMonth in varchar2) is begin if pstrYearMonth ='all' then insert into b (select * from a); else insert into b (select * from a where to_char(datetime,'yyyy-mm')=pstrYearMonth); end if; end p_test;
CREATE OR REPLACE PROCEDURE p_test(pstrYearMonth in varchar2)
is
begin
if pstrYearMonth ='all' then
insert into b (select * from a);
else
insert into b (select * from a where to_char(datetime,'yyyy-mm')=pstrYearMonth);
end if;
end p_test;