日期:2014-05-17 浏览次数:20687 次
declare sqlstr varchar2(200);
begin
for tb in (select table_name from temptablenames)
loop
sqlstr := 'select TraceType as TraceStatus,[Category] as WayID,LProductCode as QueryBigit,Tdate as QueryDate,ProvinceName,CITYNAME from tb.table_name';
insert into tempTData execute immediate sqlstr;
end loop;
end;
declare
sqlstr varchar2(2000);
begin
for tb in (select table_name from temptablenames)
loop
sqlstr := 'insert into tempTData select TraceType ,Category ,LProductCode,Tdate ,ProvinceName,CITYNAME from '
------其他解决方案--------------------
tb.table_name;
execute immediate sqlstr;
end loop;
--commit;--不提交看不到结果
end;
declare sqlstr varchar2(2000);
begin
for tb in (select table_name from temptablenames) loop
into tempTData select TraceType ,Category ,LProductCode,Tdate ,ProvinceName,CITYNAME from tb.table_name;
end loop;
--commit;--不提交看不到结果 end;
declare sqlstr varchar2(2000); begin for tb in (select table_name from temptablenames) loop into tempTData select TraceType ,Category ,LProductCode,Tdate ,ProvinceName,CITYNAME from tb.table_name; end loop;
end;