存储过程

create or replace procedure pro_t_alarm_obj_arch_yf is

sql2 varchar2(2000);
begin

sql2:='
insert into t_alarm_obj_arch_yf
select * from iam.t_alarm_obj_arch_yf@yunfuerqi where to_number(to_char(sysdate-8,''yyyymmdd''))<= to_number(to_char(NE_ALARM_TIME,''yyyymmdd''))
and to_number(to_char(NE_ALARM_TIME,''yyyymmdd'')) <=to_number(to_char(sysdate-2,''yyyymmdd''))';

execute immediate sql2;
end pro_t_alarm_obj_arch_yf;

原文地址:https://www.cnblogs.com/zshboke-2015/p/5018437.html