日期:2014-05-17 浏览次数:20662 次
create or replace procedure copy_data is vn_cnt number(4) := 0; begin select count(*) into vn_cnt from XM_XXK; if vn_cnt <> 0 then delete from XM_XXK; end if; insert into XM_XXK as select * from XM_XXX@db_link; --db_link是另外一个数据库的DBLINK; commit; end;
------解决方案--------------------
改一下一楼的.
create or replace procedure copy_data
is
vn_cnt number(4) := 0;
begin
select count(*) into vn_cnt from XM_XXK;
if vn_cnt <> 0 then
truncate table XM_XXK; --此次避免多次执行后生成高水位线,降低查询速度.
end if;
insert into XM_XXK as select * from XM_XXX@db_link; --db_link是另外一个数据库的DBLINK;
commit;
end;