oracle 存储过程实现大量表导入数据
先获取大量表的名称GPS_HT_%,要导入的数据内容格式一样。
再用过程导入数据,'insert into '||c.tname||' select * from gps_ht_0';
create or replace procedure p_insert_gps_ht(a in number,b in number) is
t_sql varchar2(2000);begin
for c in (select tname
from (select rownum sq, tname
from tab
where tname like 'GPS_HT_%'
order by tname)
where sq >= a
and sq <= b) loop
t_sql:='insert into '||c.tname||' select * from gps_ht_0';
execute immediate t_sql;
commit;
end loop;
end p_insert_gps_ht;
目录 返回
首页