Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

reorganizing table columns

555329Jan 8 2009 — edited Jan 8 2009
Hello Everyone,

working on oracle 10g R2 /Windows, I need to reorganize a table containing at least 50 columns.

Original Table
SQL> desc EMP
Name Null? Type
----------------------------------------- -------- -----------------
ALL_CUSTOMER_ID NOT NULL NUMBER(9)
NAME VARCHAR2(65)
ALL_CUSTOMER_TYPE VARCHAR2(1)
FIRST_NAME VARCHAR2(65)
LAST_NAME VARCHAR2(65)
SALUTATION VARCHAR2(5)
.
.
.

Target Table after reorganizing columns

SQL> desc EMP
Name Null? Type
----------------------------------------- -------- -----------------
ALL_CUSTOMER_ID NOT NULL NUMBER(9)
FIRST_NAME VARCHAR2(65)
NAME VARCHAR2(65)
SALUTATION VARCHAR2(5)
LAST_NAME VARCHAR2(65)
ALL_CUSTOMER_TYPE VARCHAR2(1)
.
.
.
Because the table has at least 50 columns, I need a way to automatically reorganize all columns within, there is a built-in function or procedure or a custom script to do this? I do have at least 200 tables to reorganize in this way and I need to automate the work.

Thanks for your help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2009
Added on Jan 8 2009
6 comments
1,078 views