Oracle converts the table name and field name to uppercase

Source: Internet
Author: User

Oracle converts the table name and field name to uppercase. When using powerdesigner to create a database, pay attention to Case sensitivity. Note: The following scripts are correctly executed on oracle 10g and 11g to convert table names to uppercase 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 | 'existing '); end loop; end; batch convert all field names of all tables in the space into uppercase begin www.2cto.com for t in (select table_name tn from user_tables) loop begin for c in (select column_name cn from user_tab_columns where table_name = t. tn) loop begin execute immediate 'alter table "'| t. tn | '"rename column"' | c.cn | '"to' | c.cn; exception when others then dbms_output.put_line (t. tn | '. '| c.cn |' already exists '); end loop; end; change all table names and fields in the user space to uppercase begin for t in (select table_name tn from user_tables where table_name <> upper (table_name )) loop begin for c in (select column_name cn from user_tab_columns where table_name = t. tn) loop begin execute immediate 'alter table "'| t. tn | '"rename column"' | c.cn | '"to' | c.cn; www.2cto.com exception when others then dbms_output.put_line (t. tn | '. '| c.cn |' already exists '); end loop; execute immediate 'alter table "' | t. tn | '"rename to' | t. tn; exception when others then dbms_output.put_line (t. tn | 'already exist'); end loop; end; Author: peel pomelo

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.