reorganizing table columns
555329Jan 8 2009 — edited Jan 8 2009Hello 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