create or replace procedure updateAll is
----替换所有的表,并且表中所有的字段
tmp_table user_tables.TABLE_NAME%type;
begin
for rec in (select table_name from user_tables) loop
select table_name into tmp_table from user_tables where table_name =rec.table_name;
for r in (select column_name from user_tab_cols where table_name=tmp_table) loop
execute immediate 'update '
||
tmp_table
||
' set '
||
r.column_name
||
'= replace( '
||
r.column_name
||
',''开封'',''深圳'') where '
||
r.column_name
||
' like ''%开封%'' ';
commit;
--- update ACT_GE_BYTEARRAY set rev_ =replace(id_,'开封','深圳') where rev_ like '%开封%'
end loop;
end loop;
end updateAll;