求问各路大神!!!!!!!!
下面是我写的一段存储过程 是指每隔一段时间就要对op_m_test1表进行更新,写完可以通过,但是扩展性差,现在是只有5条数据,以后可能要上百条数据,有什么办法可以对其改善吗
create or replace procedure pro_op_m_test
as
tab1 dw2.dw2_etl_com@bi52%rowtype;
tab2 dw2.dw2_etl_com@bi52%rowtype;
tab3 dw2.dw2_etl_com@bi52%rowtype;
tab4 Itf2.Inter_Cfg@bi52%rowtype;
tab5 ST.BI_JOB_LIST@FJBIJS_ST%rowtype;
op_tab1 op_m_test1%rowtype;
op_tab2 op_m_test1%rowtype;
op_tab3 op_m_test1%rowtype;
op_tab4 op_m_test1%rowtype;
op_tab5 op_m_test1%rowtype;
begin
select * into op_tab1 from op_m_test1 where table_name='DW_SRV_4GCUUSER_DT';
select * into op_tab2 from op_m_test1 where table_name='DW_IS_MVUSER_DI';
select * into op_tab3 from op_m_test1 where table_name='DW_IS_ALUSER_DI';
select * into op_tab4 from op_m_test1 where table_name='ODS_2IMSG_MSGJH';
select * into op_tab5 from op_m_test1 where table_name='CELL_INFO';
select * into tab1
from dw2.dw2_etl_com@bi52 t where t.tablename='DW_SRV_4GCUUSER_DT';
select * into tab2
from dw2.dw2_etl_com@bi52 t where t.tablename='DW_IS_MVUSER_DI';
select * into tab3
from dw2.dw2_etl_com@bi52 t where t.tablename='DW_IS_ALUSER_DI';
select * into tab4
from Itf2.Inter_Cfg@bi52 T WHERE T.TABLENAME='ODS_2IMSG_MSGJH';
select * into tab5
from ST.BI_JOB_LIST@FJBIJS_ST T WHERE T.ITFDATE='20170911' AND SRCTABLEname='CELL_INFO';
if op_tab1.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab1.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab1.stoptime,
datafile_day=tab1.optime,
status=tab1.status,
status_name=(case tab1.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='DW_SRV_4GCUUSER_DT';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='DW_SRV_4GCUUSER_DT';
end if;
if op_tab2.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab2.status=0 then
dbms_output.put_line('no update');
else
dbms_output.put_line('this');
update op_m_test1 set stop_time=tab2.stoptime,
datafile_day=tab2.optime,
status=tab2.status,
status_name=(case tab2.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='DW_IS_MVUSER_DI';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='DW_IS_MVUSER_DI';
end if;
if op_tab3.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab3.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab3.stoptime,
datafile_day=tab3.optime,
status=tab3.status,
status_name=(case tab3.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='DW_IS_ALUSER_DI';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='DW_IS_ALUSER_DI';
end if;
if op_tab4.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab4.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab4.endtime,
datafile_day=tab4.itfdate,
status=tab4.loadyn,
status_name=(case tab4.loadyn
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='ODS_2IMSG_MSGJH';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='ODS_2IMSG_MSGJH';
end if;
if op_tab5.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab5.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab5.endtime,
datafile_day=tab5.itfdate,
status=tab5.status,
status_name=(case tab5.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='CELL_INFO';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='CELL_INFO';
end if;
commit;
end pro_op_m_test;
create or replace procedure pro_op_m_test
as
tab1 dw2.dw2_etl_com@bi52%rowtype;
tab2 dw2.dw2_etl_com@bi52%rowtype;
tab3 dw2.dw2_etl_com@bi52%rowtype;
tab4 Itf2.Inter_Cfg@bi52%rowtype;
tab5 ST.BI_JOB_LIST@FJBIJS_ST%rowtype;
op_tab1 op_m_test1%rowtype;
op_tab2 op_m_test1%rowtype;
op_tab3 op_m_test1%rowtype;
op_tab4 op_m_test1%rowtype;
op_tab5 op_m_test1%rowtype;
begin
select * into op_tab1 from op_m_test1 where table_name='DW_SRV_4GCUUSER_DT';
select * into op_tab2 from op_m_test1 where table_name='DW_IS_MVUSER_DI';
select * into op_tab3 from op_m_test1 where table_name='DW_IS_ALUSER_DI';
select * into op_tab4 from op_m_test1 where table_name='ODS_2IMSG_MSGJH';
select * into op_tab5 from op_m_test1 where table_name='CELL_INFO';
select * into tab1
from dw2.dw2_etl_com@bi52 t where t.tablename='DW_SRV_4GCUUSER_DT';
select * into tab2
from dw2.dw2_etl_com@bi52 t where t.tablename='DW_IS_MVUSER_DI';
select * into tab3
from dw2.dw2_etl_com@bi52 t where t.tablename='DW_IS_ALUSER_DI';
select * into tab4
from Itf2.Inter_Cfg@bi52 T WHERE T.TABLENAME='ODS_2IMSG_MSGJH';
select * into tab5
from ST.BI_JOB_LIST@FJBIJS_ST T WHERE T.ITFDATE='20170911' AND SRCTABLEname='CELL_INFO';
if op_tab1.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab1.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab1.stoptime,
datafile_day=tab1.optime,
status=tab1.status,
status_name=(case tab1.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='DW_SRV_4GCUUSER_DT';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='DW_SRV_4GCUUSER_DT';
end if;
if op_tab2.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab2.status=0 then
dbms_output.put_line('no update');
else
dbms_output.put_line('this');
update op_m_test1 set stop_time=tab2.stoptime,
datafile_day=tab2.optime,
status=tab2.status,
status_name=(case tab2.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='DW_IS_MVUSER_DI';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='DW_IS_MVUSER_DI';
end if;
if op_tab3.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab3.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab3.stoptime,
datafile_day=tab3.optime,
status=tab3.status,
status_name=(case tab3.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='DW_IS_ALUSER_DI';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='DW_IS_ALUSER_DI';
end if;
if op_tab4.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab4.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab4.endtime,
datafile_day=tab4.itfdate,
status=tab4.loadyn,
status_name=(case tab4.loadyn
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='ODS_2IMSG_MSGJH';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='ODS_2IMSG_MSGJH';
end if;
if op_tab5.datafile_day=to_char(sysdate,'yyyymmdd')-1 and op_tab5.status=0 then
dbms_output.put_line('no update');
else
update op_m_test1 set stop_time=tab5.endtime,
datafile_day=tab5.itfdate,
status=tab5.status,
status_name=(case tab5.status
when 0 then '加载成功'
when 1 then '正在抽取'
when -1 then '执行失败'
end)
where table_name='CELL_INFO';
insert into op_m_h_test select table_name,datafile_day,status,status_name,sysdate from op_m_test1 where table_name='CELL_INFO';
end if;
commit;
end pro_op_m_test;
...全文
相关推荐
通达信各路资金博弈指标.doc
通达信各路资金博弈指标.doc
各路社交产品的用户群体有哪些特征?
纵观各路社交产品的宣传手段,很少有产品将落脚点放在用户的多样性上,这让我们隐约看到一个从移动端起家的产品有着区别于PC端起家产品的风格,而这种产品的生态氛围也决定了用户会有的样子。本文也借此对比分析一下移动产品用户与那些从PC端起步的社交产品用户的具体区别。陌陌与PC端所有社交产品最大的不同就源于更加完善和丰富的用户信息,PC端的社交大多停留在线上,并不需要太多的用户信息,所以更多的只是一种纯粹的兴趣群落结网聚合,大家都躲在电脑后面与他人交流,而这种信息的不透明性直接导致了用户间的不信任。陌陌用户与其他平台的用户相比较,则更加真实。通讯录、微博账号等内容的关联,让用户信息更加完善,同时也增强了
IT各路大神对云安全知识的实践和分享.rar
IT各路大神对云安全知识的实践和分享
VB海康监控登录源码,可查询各路图像
VB海康监控登录源码,可查询各路图像
近百篇关于图像深度学习的论文列表集合(各路大神论文、模型发表论文)
截止到2019/07/14日之前的,各路大神关于图像处理、深度学习的论文索引,包括多种经典的神经网络模型的具体阐述。


