Oracle table name and column name lowercase to uppercase

Source: Internet
Author: User

Bulk change the table name to uppercase begin   for C in (select table_name TN from USER_TABLES where TABLE_NAME <> UPPER (table_name)) Lo op       begin          EXECUTE immediate ' ALTER TABLE ' | | c.tn| | ' Rename to ' | | c.tn;       exception          When others then        &N Bsp    dbms_output.put_line (c.tn| | ' already exists ');       end;   end loop; end;    all field names in all tables in the space are capitalized   This method may cause overflow begin     for T in (select table_name tn from User_tables) loop      begin  &N Bsp      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;            &NBSP;EXCEption                When others then            &NB Sp      dbms_output.put_line (t.tn| | | c.cn| | ' already exists ');             end;         end loop;      end;  End loop; end;   

Capitalize all column names in the feature table Property_info lowercase
Begin
For C in (select Column_name cn from All_tab_columns where table_name= ' Property_info ') loop
Begin
Execute immediate ' ALTER TABLE property_info rename column ' | | c.cn| | ' to ' | | c.cn;
exception
When others then
Dbms_output.put_line (' Property_info ' | | '. ' | | c.cn| | ' already exists ');
End
End Loop;
End

Oracle table name and column name lowercase to uppercase

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.