1 Reply Latest reply on Nov 8, 2013 12:24 AM by thatJeffSmith-Oracle

    How can I get Modify, Drop, Add Column ...Script information for Column(s) to do some changes?

    Erhan_toronto

      Hi Oracle Experts,

       

      I have a challenging question . Lets say I have two table with same name, but these two tables comes from two different databases with 2 different users.

       

       

      Source Database A and User SCOTT

       

      TableColumnData_TypeLengthPrecisionScalePrimary KeyNullableDefaultComment
      BOOKSBOOK_IDVarchar24--1---
      ISBN_10Varchar2

      13

      ---yes--
      PRICENumber-62-yes--

       

       

      Target Database B and User DAVID


       

      TableColumnData_TypeLengthPrecisionScalePrimary KeyNullableDefaultComment
      BOOKSBOOK_IDVarchar220--1---
      PRICENumber-62-yes--
      TITLEVarchar250---yes--

       

      What I want to do:

       

      I want to get a query script that shows which columns need to modify, add and drop depends on source table (Make any necessary changes to make Target table columns same as Source table columns) . No need to do any changes in the database only want to see the query that needs to run for making these changes.

       

      EXAMPLE: I was using below query to get EMP table creation query. But seeing column information to create same column for other user is hard:(

      select dbms_metadata.get_ddl ('TABLE', 'EMP')  from dual