日期:2014-05-17 浏览次数:20998 次
create or replace procedure pro_report_hour
is
cursor table_names --获得很多需要的表,表名以collect_datat_开头
is
select table_name from user_tables where table_name like 'collect_datat_%';
TYPE data_id_table is table of report_hour.data_collector_id %TYPE;
ids data_id_table; -- 用ids 存 获得的data_collector_id集
begin
for tab_name in table_names loop
execute immediate 'select data_collector_id
bulk collect into ids from' ||tab_name;
.....
end loop;
end pro_report_hour;