create or replace procedure createtable_procedure
Authid Current_User
as
table_name varchar2(200);
str_sql varchar2(1000);
begin
select 'BSS_EPON_INTERFACE' || to_char(sysdate-1, 'yyyymmdd') into table_name from dual;
execute immediate 'create table ' ||table_name ||' as select * from bss_epon_interface_explain where 1 != 1';
commit;
insert into bss_epon_interface_explain select e.area_fathername,e.area_name,a.orderid,c.prod_name,b.ybt_name,a.accnbr
,d.error_explain,d.b_department,d.error_solution,a.lcode,a.d_ipaddress,a.p_lcode,a.gw_name,
a.gw_ip,
a.createtime,
a.error_code, a.exec_log,' ' as query_log
from bss_epon_interface a ,s_yzfbilltype b,b_c_producttype c,d_e_relation d,yzf_area e
where a.sn_no=d.sn_no and a.ordertypeid=b.ybt_id and a.prodspecid=c.prod_id and
a.areaid=e.area_id and a.sn_no is not null;
commit;
str_sql:='insert into' ||table_name ||'select * from bss_epon_interface_explain;';
execute immediate str_sql;
commit;
end;
标识符过长
------解决方案--------------------
create or replace procedure createtable_procedure
Authid Current_User 你吧这个去掉试试,用定义者身份来执行