Skip to Main Content

SQL & PL/SQL

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!

How to convert Object type column into RDMS column using DBMS_REDIFINITION

715920Oct 10 2011 — edited Oct 11 2011
Dear all,
suppose I have the following table to convert:
create table customer as select customer_id cid, cust_first_name name, cust_address street from customers;
alter table customer modify cid primary key;
I created the table based on customers table of OE schema whereas the street column has object type of cust_address_typ with the following attribute
SQL> describe cust_address_typ
 Name						       Null?	Type
 ----------------------------------------------------- -------- ------------------------------------
 STREET_ADDRESS 						VARCHAR2(40)
 POSTAL_CODE							VARCHAR2(10)
 CITY								VARCHAR2(30)
 STATE_PROVINCE 						VARCHAR2(10)
 COUNTRY_ID							CHAR(2)
I want to convert street_address attribute object into a rdms column. Consider the following interim table:
CREATE TABLE INT_CUSTOMER(
CID NUMBER,
NAME VARCHAR2(30),
street varchar2(100)
);
First, I verifed if the table can be redefined:
--Verify if the table can be redefined
BEGIN
DBMS_REDEFINITION.CAN_REDEF_TABLE('OE','CUSTOMER',DBMS_REDEFINITION.CONS_USE_PK);
END;
 4  /

PL/SQL procedure successfully completed.
But when I started the redefinition, I got an error:
BEGIN
DBMS_REDEFINITION.START_REDEF_TABLE(
uname => 'OE',
orig_table => 'CUSTOMER',
int_table => 'INT_CUSTOMER',
col_mapping => 'CID CID, NAME NAME, STREET CUST_ADDRESS_TYP(STREET_ADDRESS)'
);
END;
  9  /
BEGIN
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
ORA-06512: at "SYS.DBMS_REDEFINITION", line 52
ORA-06512: at "SYS.DBMS_REDEFINITION", line 1646
ORA-06512: at line 2
What seemed to be the problem?

Best regards,
Val

Edited by: Valerie Debonair on Oct 9, 2011 9:43 PM
This post has been answered by Kim Berg Hansen on Oct 11 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2011
Added on Oct 10 2011
12 comments
431 views