How to convert the column of ROW using DBMS_REDIFINITION object type column

Hi 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 the customers of the OE schema table, while the street column has cust_address_typ with the following attribute object type
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 the object attribute adresse_rue in a column of RDM. Consider the following temporary table:
CREATE TABLE INT_CUSTOMER(
CID NUMBER,
NAME VARCHAR2(30),
street varchar2(100)
);
First of all, I checked 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

Published by: Valerie good-natured October 9, 2011 21:43

Have you tried this one:

BEGIN
DBMS_REDEFINITION.START_REDEF_TABLE(
uname => 'OE',
orig_table => 'CUSTOMER',
int_table => 'INT_CUSTOMER',
col_mapping => 'CID CID, NAME NAME,"CUSTOMER".STREET.STREET_ADDRESS STREET'
);
END;

Looking at your trace file, I claim that when you use the call above to START_REDEF_TABLE, the inner workings of this procedure will create this SQL statement:

select CID CID, NAME NAME,"CUSTOMER".STREET.STREET_ADDRESS STREET from "OE"."CUSTOMER" "CUSTOMER"

(You can prove or disprove my claim by tracing it ;-)))

And this statement has had an alias - even if the alias is the same as the name of the table...

Tags: Database

Similar Questions

  • How to convert the column lines

    I need to convert my output lines of sql for the column as a pivot to 11g

    Please give me the example of this

    check out this link

    http://nimishgarg.blogspot.com/2010/06/Oracle-pivot-data-rows-to-columns.html

    request for 10g would be

    Select *.
    (select job,
    Sum (decode(DEPTNO,10,SAL)) dept10,
    Sum (decode(DEPTNO,20,SAL)) dept20,
    Sum (decode(DEPTNO,30,SAL)) dept30,
    Sum (decode(DEPTNO,40,SAL)) dept40
    from scott.emp
    Working Group)
    order by 1;

  • How to convert the column online

    Hello

    Do is samble of my data, I need to convert columns into rows

    create table uload_table (id1 number, tidset varchar2(200));
    
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,1);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,2);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,3);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,4);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,5);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,7);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,8);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (1,10);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,2);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,3);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,4);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,5);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,8);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,9);
    Insert into UNLOAD_TABLE (ID1,TIDSET) values (2,10);
    select * FROM UNLOAD_TABLE ;
    ID1      TIDSET
    ----- ----------   
    1     1
    1     2
    1     3
    1     4
    1     5
    1     7
    1     8
    1     10
    2     2
    2     3
    2     4
    2     5
    2     8
    2     9
    2     10
    I need the result to be as below.
    ID1      TIDSET
    ----- ----------   
    1     ;1;2;3;4;5;7;8;10
    2     ;2;3;4;5;8;9;10
    any help please,.

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e26088/functions089.htm#SQLRF30030

    Concerning

    Etbin

  • How to convert the precision extended float to float in C++

    Hello

    Could someone me please how to convert the extended precision (floatExt) float normal float in C++?

    What is the difference in the float between Labview and C++ data type?

    When I tried to receive a range of float of a function of the DLL generated by Labview in C++, data are bad.

    Thank you

    Victor King

    You can search for numeric data types in LabVIEW help for more information on the different types of data. Before sending the data to the C++ application, you can use the function of Double precision on digital / range of Conversion to convert number to Double precision.

  • How to keep the columns of history in capital letters?

    Hello

    Is there a way to convert the columns that are marked as columns of history (ex: Created_By, Updated_By) uppercase and then store them in the database table? Once these columns are marked as history columns, Set accessor methods are not generated in the EOImpl class, and whenever a record is created or updated, the created_by and updated_by on these recordings are filled automatically by the framework using the name of securityContext so my interpretation is not bad.

    Is it possible to override this to ensure that whenever a transaction takes place, these columns are always inserted/updated on top of case?

    Thank you.

    You will need to return username converted to uppercase if the kind of story is HISTORY_CREATE_USER.

    So it should look like this:

    protected Object getHistoryContextForAttribute(AttributeDefImpl attributeDefImpl){
        if(attributeDefImpl.getHistoryKind()==AttributeDefImpl.HISTORY_CREATE_USER){
            return ADFContext.getCurrent().getSecurityContext().getUserName().toUpperCase();
        }else{
            return super.getHistoryContextForAttribute(attributeDefImpl);
        }
    }
    

    Dario

  • How to convert a site MUSE for use on a smart phone?

    How to convert a site MUSE for use on a smart phone? Is it possible to automate this? I have to reduce all image sizes?

    In the current version of Muse, you have to look at the top bar in the Plan view and click on the button of phone . It offers you the ability to copy the plan of the pages (if you think it's useful for your mobile website), but not the content. Yes, you must manually copy and paste what you want to be present on mobile pages.

    With the upcoming version, you also get a different approach, next to it.

    Take a look: https://Max.Adobe.com/sessions/Max-online/#/video/4923

  • Please how to convert the photo to the second

    2012-Kia-Rio-SX-side1.jpg11707850_10153403835594354_514303523436587694_n-1.jpg

    Please guys how to convert the kia rio pictures the second perfect like this, and with any program, I know that all steps in details please its very important

    That looks just like you would use the tool pen to redraw on the image and create shape layers (black areas). It could be done in Photoshop or Illustrator.

    Using Photoshop | Draw with the pen tools

  • convert the column to a string name

    pls help me.

    I need to know how can I convert the column to a string name because I can not insert the column name into my table.


    for matrix (SELECT nom_de_colonne
    OF all_col_comments@myDBLink
    WHERE UPPER (trim (table_name)) = "ROLEMATRIX")
    loop
    INSERT INTO myTABLE (myColumn)
    VALUES (matrix.column_name);
    end loop;


    my error:
    ORA-00984: column not allowed here

    which line you are confronted with error, because I've also tested this, his work on my side!

  • How to change the column ordering the interactive report?

    How to change the column ordering the interactive report?

    Hello

    Run the report as a developer, click on the "wonder wheel", click "Select columns" and reorder your columns in the box 'report '.
    Then click again on the "wonder wheel", click on save report and save the default state.

    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this response in marking it as useful or Correct ;-)

  • Windows 8, 32-bit: how to cancel the file history and use the USB for the sole purpose Ready Boost

    By mistake, I clicked file history on. The USB key used for ready boost is selected and that the disk is write protected. Windows 8, 32-bit: how to cancel the file history and use the USB for the sole purpose Ready Boost. I don't have an another USB suitable for ready boost.

    Hello

    You should be able to disable the history of files by using the local Group Policy Editor.  Consult this publication of the article.  Use the #2 option.

  • How to find the right server to use windowsmail to send and receive e-mails?

    How to find the right server to use windowsmail to send and receive e-mails?

    Who is your current e-mail server? (Which is after the @ in your address).
     
  • How to convert the date in milliseconds?

    Hi all

    Can I know how to convert the date in milliseconds?

    My current datetime like this Formate

    QDateTime::currentDateTime (m:System.NET.SocketAddress.ToString ("MMMM dd, yyyy HH"))

    Seconds since January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toTime_t

    Sinds milliseconds January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toMSecsSinceEpoch

  • How to decompress the files downloaded for use with Windows 7?

    How to decompress the files downloaded for use with Windows 7.  Specifically, zip files are a Magellan GPS unit.

    There are instructions at: http://windows.microsoft.com/en-us/windows7/compress-and-uncompress-files-zip-files

  • Hello, I have a full desktop in Adobe Muse, site and I want to convert it into a version Tablet & phone, then, how would convert the site Office to Tablet & phone to copy the entire office content and site structure? Thanks for any help.

    Hello, I have a full desktop in Adobe Muse, site and I want to convert it into a version Tablet & phone, then, how would convert the site Office to Tablet & phone to copy the entire office content and site structure? Thanks for any help.

    You can not automatically convert. Click on the "tablet" or "Phone" at the top of your plan view to create these versions.

    You can then copy and paste on any content you want has more of your office.

  • How to set the height of row?

    How to set the height of row for my text in EA? I checked this article Edge animate help | Adding text to your project (tutorial) , but it refers to an old version of the environmental assessment.

    Hey Bruce,.

    You can set it in the user interface. Activate additional text settings in the property Panel by clicking on the arrow.

Maybe you are looking for