批量修改oracle表名 -- 小写到大写

xiaoxiao2021-02-28  50

1 原因

 表名小写,oracle查询需要自己带引号,比较麻烦

2 解决

批量一次修改所有表名为大写

begin for c in (select table_name tn from user_tables where table_name <> upper(table_name)) loop begin execute immediate 'alter table "'||c.tn||'" rename to '||c.tn; exception when others then dbms_output.put_line(c.tn||'已存在'); end; end loop; end;
转载请注明原文地址: https://www.6miu.com/read-2629102.html

最新回复(0)