oracle 字段全大写,oracle 批量修改表名 字段为大写[通俗易懂]

oracle 字段全大写,oracle 批量修改表名 字段为大写[通俗易懂]修改那个表空间必须用那个表空间的用户登录–oracle批量修改表名为大写(当前登录用户)beginforcin(selecttable_nametnfromuser_tableswheretable_name<>upper(table_name))loopbeginexecuteimmediate‘altertable”‘||c.tn||‘”re…

大家好,又见面了,我是你们的朋友全栈君。

修改那个表空间必须用那个表空间的用户登录

— oracle 批量修改表名为大写(当前登录用户)

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;

— oracle 批量修改列名为大写(当前登录用户)

begin

for cl in (SELECT table_name,column_name from user_tab_columns WHERE column_name<>upper(column_name) and upper(column_name) not in(‘SIZE‘,‘CHECK‘)) loop

begin

execute immediate ‘alter table ‘||cl.table_name||‘ rename column “‘|| cl.column_name ||‘” to ‘||upper(cl.column_name);

exception

when others then

dbms_output.put_line(cl.table_name||‘.‘||cl.column_name||‘已存在‘);

end;

end loop;

end;

原文:https://www.cnblogs.com/Ai-Hen-Jiao-zhi/p/13030848.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/145510.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号