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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -