任务描述:从数据中获取一定的表,再从每个表中获得一个字段集。。。
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;
Compilation errors for PROCEDURE IDC.PRO_REPORT_HOUR
Error: PLS-00306: 调用 '||' 时参数个数或类型错误
求大牛帮忙解决。。。。
------解决方案--------------------
把
bulk collect into ids from'
------解决方案--------------------
tab_name;
改成
bulk collect into ids from'
------解决方案--------------------
tab_name.table_name;