举例:
修改表TEST的所有列名为大写
begin for c in (select COLUMN_NAME cn from all_tab_columns where table_name='TEST') loop
begin execute immediate 'alter table TEST rename column "'||c.cn||'" to '||c.cn;
exception when others then dbms_output.put_line('TEST'||'.'||c.cn||'已经存在');
end;
end loop;
end;