oracle

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samsudhin
    New Member
    • Mar 2008
    • 1

    oracle

    sir,

    may have a one doubt

    how to copy the records from one table to another table with primary key option......



    please do the needful.
  • karthickkuchanur
    New Member
    • Dec 2007
    • 156

    #2
    Originally posted by samsudhin
    sir,

    may have a one doubt

    how to copy the records from one table to another table with primary key option......



    please do the needful.
    U can try like
    update table tablename set column name=(select columnname from old table)

    Comment

    • mafaisal
      New Member
      • Sep 2007
      • 142

      #3
      Hello

      Try This
      Code:
       Create Table NewTable as (Select * From OldTable)
      I think Primary key is not copy only table data

      Faisal

      Originally posted by samsudhin
      sir,

      may have a one doubt

      how to copy the records from one table to another table with primary key option......



      please do the needful.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        try using

        insert table_name1 select * from table_name2;

        But it will not copy the PK constraint.

        You need to add that by altering the table.

        Comment

        Working...