sql - How can I make a copy of a table with a PK? -
in oracle 10g database, make copy of existing table. have same data , rows original table. original table uses pk though, i'm not sure how copy , keep them unique.
you can make copy using
create table dummy_copy select * dummy//structure , data also use dbms_metadata.get_ddl associated constraints of table , create checks
select dbms_metadata.get_ddl( 'table', 'dummy' ) dual;
Comments
Post a Comment