Thanks very much . I have another followup question , have been trying all day for a solution without success, appreciate if i could get some help.
I have nested table like below which is already loaded.
create or replace TYPE access_t AS OBJECT (
AccessID VARCHAR2(50),
Eligibility char(1)
);
/
create or replace TYPE Access_tab IS TABLE OF access_t;
/
create or replace TYPE add_t AS OBJECT (
city VARCHAR2(100),
state VARCHAR2(100),
zip VARCHAR2(10),
APOINTSARRAY Access_tab )
;
/
create or replace TYPE add_tab IS TABLE OF add_t;
/
CREATE TABLE RQST_STATUS
( RQST_ID NUMBER,
ADDRESS add_tab
)
NESTED TABLE ADDRESS STORE AS RQST_STATUS_ADDRESS
( NESTED TABLE APOINTSARRAY STORE AS RQST_STATUS_AP)
;
Now without changing TYPE add_t (since its used in other tables which do not need this change) , i need to add 2 additional columns to ADDRESS.
I took backup of the table , altered the table to add another new field.
create or replace TYPE add_t_new AS OBJECT (
city VARCHAR2(100),
state VARCHAR2(100),
zip VARCHAR2(10),
APOINTSARRAY Access_tab,
Latitude VARCHAR2(10),
Longitude VARCHAR2(10),
)
;
/
create or replace TYPE add_tab_new IS TABLE OF add_t_new;
/
CREATE TABLE RQST_STATUS
( RQST_ID NUMBER,
ADDRESS add_tab
)
NESTED TABLE ADDRESS STORE AS RQST_STATUS_ADDRESS
( NESTED TABLE APOINTSARRAY STORE AS RQST_STATUS_AP)
;
ALTER TABLE RQST_STATUS ADD
(
ADDRESS_NEW add_tab_new
)
NESTED TABLE ADDRESS_NEW STORE AS ADDRESS_NEW_V1
(NESTED TABLE APOINTSARRAY STORE AS APOINTSARRAY_V1) ;
So now , i have old and new fields in the same table.
How can i now insert data from old field to new field ? with null values for the 2 additional fields.
I intend to drop the old column and then rename the new column to old after.
Thanks.