软讯网络 > 冲浪宝典 > 网络资源 > Oracle跨ower操作
【标 题】:Oracle跨ower操作
【关键字】:
Oracle,ower
【来 源】:http://blog.csdn.net/feiliu010/archive/2007/01/11/1480298.aspx
Oracle跨ower操作
create or replace procedure SP_ChangeOneTabToAnother is
strSql varchar2(200);
begin
dbms_output.put_line('begin');
for c_colName in ( select t.column_name
from ALL_TAB_COLUMNS t
where t.table_name='Table1'
and t.data_type like 'NUMBER%'
and t.owner = 'Owner1')
loop
dbms_output.put_line(c_colName.Column_Name);
strSql:='update owner2.table2 set ' || c_colName.Column_Name||' =0 where '|| c_colName.Column_Name|| ' is null';
dbms_output.put_line(strSql);
execute immediate strSql;
commit;
end loop;
end SP_FACARD_NUMMOD;
/
exec SP_FACARD_NUMMOD;